I\'m wondering if there is a way to insert new document and return it in one go.
This is what I\'m currently using:
db.collection(\'mycollection\').i
The following code worked for me, in MongoDB version 2.2.33.
db.collection("sample_collection").insertOne({ field1: "abcde" }, (err, result) => { if(err) console.log(err); else console.log(result.ops[0].field1) }