node.js - What does err and doc mean in cursor.toArray(function(err, docs){})? -
this official mongodb documentation.
toarray cursor.toarray(function(err, docs){})
converts cursor object array of matching records. convenient way retrieve results careful large datasets every record loaded memory.
collection.find().toarray(function(err, docs){ console.log("retrieved records:"); console.log(docs); });
what err , doc mean in cursor.toarray(function(err, docs){})?
docs
array documents returned cursor.
when there error, err
object describes error.
Comments
Post a Comment