MONGOC_GRIDFS...STREAM_WITH_ID(3)
β¨ MONGOC_GRIDFS...STREAM_WITH_ID(3) β¨
okay bestie, welcome to the libmongoc manual page for mongoc_gridfs...stream_with_id β yes that's the truncated title, the real function is mongoc_gridfs_bucket_open_upload_stream_with_id and it's lowkey iconic π
πΈ SYNOPSIS πΈ
mongoc_stream_t *
mongoc_gridfs_bucket_open_upload_stream_with_id (mongoc_gridfs_bucket_t *bucket,
const bson_value_t *file_id,
const char *filename,
const bson_t *opts,
bson_error_t *error);
that's the whole vibe check right there, no cap β¨
π PARAMETERS π
bucketβ Amongoc_gridfs_bucket_t. the main character of this whole operation π«Άfile_idβ Abson_value_tspecifying the id of the created file. you pick the id, you're in charge, periodt πfilenameβ The name of the file to create. name it something cute fr fr π¦optsβ Abson_torNULL. optional-ish, we love a flexible queen πerrorβ Abson_error_tto receive any error orNULL. catch those L's if you want, or don't π
opts may be NULL or a BSON document with additional command options:
chunkSizeBytesβ Anint32chunk size to use for this file. Overrides thechunkSizeBytesset onbucket. so like, it overrides the bucket setting, it said what it said πmetadataβ Abson_trepresenting metadata to include with the file. little extra lore for your file, we love to see it π
π¦ DESCRIPTION π¦
Opens a stream for writing to a new file in GridFS for a specified file id. literally opening the stream, handing it a file id, and being like "go off" π«
not me about to say something important: to havelibmongocgenerate an id for you instead, usemongoc_gridfs_bucket_open_upload_stream(). let the library pick, it's got range π
β RETURNS β
A mongoc_stream_t that can be written to or NULL on failure. Errors on this stream can be retrieved with mongoc_gridfs_bucket_stream_error(). π
After calling mongoc_stream_close() the file is completely written in GridFS. like, fully done, ate and left no crumbs π₯
π SEE ALSO: π
mongoc_gridfs_bucket_open_upload_stream()mongoc_gridfs_bucket_stream_error()
π AUTHOR π
MongoDB, Inc β the icons themselves π
π COPYRIGHT π
2009-present, MongoDB, Inc.
and that's the whole page bestie, ily, go write some files π β¨
version 2.5.6 πΈ dated Oct 09, 2026 π β mwah, see u in the next manpage π«Ά
π¦ where this page comes from
- epel 10: mongo-c-driver-devel 2.5.6-1.el10_3 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms