GridFS image insert with C driver

Hey, im a newbie and im want to use scrot to make screenshots and than add them to my mongodb. I’ve read the guides on GridFS and C Drivers but im still kinda lost in what to add to the scrot script so it can send them to mongodb.

Hi @Vasil_N_A!

I’m not too familiar with scrot, but if you want to use it to capture screenshots, and store the screenshot contents in a MongoDB collection via the C driver, perhaps start with an application that takes a filename as an argument and uses the C driver’s mongoc_gridfs_bucket_t to save it? There is an example of that GridFS code here: http://mongoc.org/libmongoc/current/mongoc_gridfs_bucket_t.html

Best,
Kevin

Thanks for the answer it was somewhat useful, but i was wondering if you can save all existing photos from a folder to mongodb?