1MONGOC_GRIDFS_BUCKET_UPLOAD_FROMM_oSnTgRoEDMABOMN(CG3O)DCr_iGvReIrDFS_BUCKET_UPLOAD_FROM_STREAM(3)
2
3
4

NAME

6       mongoc_gridfs_bucket_upload_from_stream              -             mon‐
7       goc_gridfs_bucket_upload_from_stream()
8

SYNOPSIS

10          bool
11          mongoc_gridfs_bucket_upload_from_stream (mongoc_gridfs_bucket_t *bucket,
12                                                   const char *filename,
13                                                   mongoc_stream_t *source,
14                                                   const bson_t *opts,
15                                                   bson_value_t *file_id,
16                                                   bson_error_t *error);
17

PARAMETERS

19       · bucket: A mongoc_gridfs_bucket_t.
20
21       · filename: The name of the file to create.
22
23       · source: A mongoc_stream_t used as the source of the data to upload.
24
25       · opts: A bson_t or NULL.
26
27       · file_id: A bson_value_t to receive the generated id of  the  file  or
28         NULL.
29
30       · error: A bson_error_t to receive any error or NULL.
31
32       opts may be NULL or a BSON document with additional command options:
33
34       · chunkSizeBytes:  An  int32 chunk size to use for this file. Overrides
35         the chunkSizeBytes set on bucket.
36
37       · metadata: A bson_t representing metadata to include with the file.
38

DESCRIPTION

40       Reads from the source stream and writes to a new file  in  GridFS.  The
41       file  id  is  generated automatically.  To specify an explicit file id,
42       use mongoc_gridfs_bucket_upload_from_stream_with_id().
43
44       Reads from the  source  stream  using  mongoc_stream_read()  until  the
45       return  value  indicates  end-of-file.  The source stream is not closed
46       after  calling  mongoc_gridfs_bucket_upload_from_stream();  call   mon‐
47       goc_stream_close() after.
48

SEE ALSO

50       mongoc_stream_file_new  and  mongoc_stream_file_new_for_path, which can
51       be used to create a source stream from a file.
52

RETURNS

54       True if the operation succeeded. False otherwise and sets error.
55

AUTHOR

57       MongoDB, Inc
58
60       2017-present, MongoDB, Inc
61
62
63
64
651.14.0                           FebM2O2N,GO2C0_1G9RIDFS_BUCKET_UPLOAD_FROM_STREAM(3)
Impressum