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