I have a buffer i.e a char pointer which has some jSON data itself ,so I want to insert this data into Mongodb.
My approach is,
char *buff=NULL;
{buff has some JSON data}
mongo::BSONObj *obj_data= new mongo::BSONObj(buff) ;
conn.insert( "mydb.testcollect",obj_data,0);
I am getting this message,
error: no matching function for call to ‘mongo::DBClientConnection::insert(const char [17], mongo::BSONObj*&, int)’
What will be the right approach .plz help.