what's the correct way to pass in json documents for creation ?
I have the example working and ok as below : /* create a new document in collection */
db.document.create({a:"test"},function(err,ret){
if(err) console.log("error(%s): ", err,ret);
else console.log(util.inspect(ret));
});
but how do I pass in the json as an argument as this does not work ?
var json = '{a:"test"}';
db.document.create(json,function(err,ret){
if(err) console.log("error(%s): ", err,ret);
else console.log(util.inspect(ret));
});