回调的第二个参数
collection.insert将返回插入的一个或多个doc,其中应包含_ids。
尝试:
collection.insert(objectToInsert, function(err,docsInserted){ console.log(docsInserted);});并查看控制台,了解我的意思。

回调的第二个参数
collection.insert将返回插入的一个或多个doc,其中应包含_ids。
尝试:
collection.insert(objectToInsert, function(err,docsInserted){ console.log(docsInserted);});并查看控制台,了解我的意思。