What is the syntax for storing large binary array in a BSON in C++?
385 views
Skip to first unread message
Alex
unread,
Oct 20, 2011, 2:37:28 PM10/20/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongodb-user
Greetings!
I realize this is somewhere in the docs, but I just can't find it. How
do I store binary array in a BSON in C++?
Also, do I have to take certain steps to enable GridFS, or is it
enabled by default?
Thanks!
Spencer T Brody
unread,
Oct 20, 2011, 7:04:59 PM10/20/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongod...@googlegroups.com
To create a BSONObj in C++ that stores binary data, you can do something like:
GridFS is a client-side specification - nothing needs to be enabled on the server, you can just use the gridfs client in the C++ driver to put and fetch gridFS data from your mongo cluster. The GridFS C++ client documentation is here: http://api.mongodb.org/cplusplus/current/classmongo_1_1_grid_f_s.html.