I have very specific issue. I must work through a C program to access a mongo database.
If i connect to a mongo database with a simple C program like this :
mongoc_init (); client = mongoc_client_new ("mongodb://user:pass@localhost:27017/?authSource=admin"); collection = mongoc_client_get_collection (client, "DB", "Collection");
I would now like to simply pass to this connection a shell script like this:
str = ‘db.DB.Collection.insert(name:“bob”)’
My_Mongo_Command(client, collection, str);
and have it return any output from the command as it would on the mongo command line.
I have not been able to find anything like this in the documentation but maybe i am blind.