Although the implementation mechanism is not much different from db.collection.find().limit(1) 差距太多,但用起来和 db.collection.find().limit(1),
findOne 是 找到第一条,返回数据,然后关闭游标cursor 这些操作一气喝成 db.collection.find().limit(1) is to first return the cursor, obtain the required data, and then close the cursor
The specific implementation still depends on the client...
The limit() function in mongoDB is the same as the limit in sql. The limit() function in mango is also used after the find() function.
Although the implementation mechanism is not much different from
db.collection.find().limit(1)
差距太多,但用起来和db.collection.find().limit(1)
,findOne
是 找到第一条,返回数据,然后关闭游标cursor 这些操作一气喝成db.collection.find().limit(1)
is to first return the cursor, obtain the required data, and then close the cursorThe specific implementation still depends on the client...
One meaning