|
Hi, I can't reproduce the problem you reported. In this test, we call mongoc_gridfs_file_set_id before mongoc_gridfs_file_save and it works as designed:
https://github.com/mongodb/mongo-c-driver/blob/34be38148c7c4529323f3c536cbe8f3ae05d61ea/tests/test-mongoc-gridfs.c#L1033
You can also build the example program "example-gridfs" from "example-gridfs.c" and run it:
# arguments are "destination filename" and "source filename"
|
./example-gridfs write README README.rst
|
The outcome is a file with _id of 1, as expected.
|