why does db.collection.findOne() return less information than db.collection.find[1] in mongodb -
why db.collection.findone()
return less information db.collection.find[1]
in mongodb
i think return 1 document in mongodb, when run commands there info missing using findone method
you should use db.collection.find()[1]
if using db.collection.find
(without parentheses) return what function doing
sample output db.collection.find
(without parentheses).
function (query, fields, limit, skip, batchsize, options) { var cursor = new dbquery(this._mongo, this._db, this, this._fullname, this._massageobject(query), fields, limit, skip, batchsize, options || this.getqueryoptions()); var connobj = this.getmongo(); var readprefmode = connobj.getreadprefmode(); if (readprefmode != null) { cursor.readpref(readprefmode, connobj.getreadpreftagset()); } return cursor; }
Comments
Post a Comment