1MONGOC_GRIDFS_BUCKET_UPLOAD_FMROONMG_OSCT_RlGEiRAbIMmD_oFWnSIg_ToBHcU_CIKDE(T3_)UPLOAD_FROM_STREAM_WITH_ID(3)
2
3
4
6 bool
7 mongoc_gridfs_bucket_upload_from_stream_with_id (mongoc_gridfs_bucket_t *bucket,
8 const bson_value_t *file_id,
9 const char *filename,
10 mongoc_stream_t *source,
11 const bson_t *opts,
12 bson_error_t *error);
13
15 • bucket: A mongoc_gridfs_bucket_t.
16
17 • file_id: A bson_value_t specifying the id of the created file.
18
19 • filename: The name of the file to create.
20
21 • source: A mongoc_stream_t used as the source of the data to upload.
22
23 • opts: A bson_t or NULL.
24
25 • error: A bson_error_t to receive any error or NULL.
26
27 opts may be NULL or a BSON document with additional command options:
28
29 • chunkSizeBytes: An int32 chunk size to use for this file. Overrides
30 the chunkSizeBytes set on bucket.
31
32 • metadata: A bson_t representing metadata to include with the file.
33
35 Reads from the source stream and writes to a new file in GridFS. To
36 have libmongoc generate an id, use
37 mongoc_gridfs_bucket_upload_from_stream().
38
39 Reads from the source stream using mongoc_stream_read() until the re‐
40 turn value indicates end-of-file. The source stream is not closed af‐
41 ter calling mongoc_gridfs_bucket_upload_from_stream(); call
42 mongoc_stream_close() after.
43
45 True if the operation succeeded. False otherwise and sets error.
46
47 SEE ALSO:
48 mongoc_stream_file_new() and mongoc_stream_file_new_for_path(), which can be used to create a source stream from a file.
49
50
52 MongoDB, Inc
53
55 2017-present, MongoDB, Inc
56
57
58
59
601.25.1 MONGONCo_vGR0I8D,FS2_0B2U3CKET_UPLOAD_FROM_STREAM_WITH_ID(3)