1MONGOC_GRIDFS_FIND_ONE_WITH_OPTS(3)libmongocMONGOC_GRIDFS_FIND_ONE_WITH_OPTS(3)
2
3
4
6 mongoc_gridfs_file_t *
7 mongoc_gridfs_find_one_with_opts (mongoc_gridfs_t *gridfs,
8 const bson_t *filter,
9 const bson_t *opts,
10 bson_error_t *error)
11 BSON_GNUC_WARN_UNUSED_RESULT;
12
14 • gridfs: A mongoc_gridfs_t.
15
16 • filter: A bson_t containing the query to execute.
17
18 • opts: A bson_t query options, including sort order and which fields
19 to return. Can be NULL.
20
21 • error: An optional location for a bson_error_t or NULL.
22
24 Find the first GridFS file matching filter. If there is an error, NULL
25 is returned and error is filled out; if there is no error but no match‐
26 ing file is found, NULL is returned and the error code and domain are
27 0.
28
29 See mongoc_collection_find_with_opts() for a description of the filter
30 and opts parameters.
31
32 This function is considered a retryable read operation. Upon a tran‐
33 sient error (a network error, errors due to replica set failover, etc.)
34 the operation is safely retried once. If retryreads is false in the
35 URI (see mongoc_uri_t) the retry behavior does not apply.
36
38 Errors are propagated via the error parameter.
39
41 Returns a newly allocated mongoc_gridfs_file_t if successful. You must
42 free the resulting file with mongoc_gridfs_file_destroy() when no
43 longer in use.
44
46 MongoDB, Inc
47
49 2017-present, MongoDB, Inc
50
51
52
53
541.25.1 Nov 08, 202M3ONGOC_GRIDFS_FIND_ONE_WITH_OPTS(3)