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