Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
最近看到一个关于SQL中加入 LIMIT 1 是否会更快的问题,
LIMIT 1
我就想起了mongodb里的 findOne
findOne
db.collection.findOne(query)
不知道是不是跟SQL的一样,还是说跟db.collection.find().limit(1)一样?
db.collection.find().limit(1)
两者的查询效率和执行流程有什么不同?
@oughl0007
以前討論過...
findone 返回 doc
find() 返回 iterator
有有有~ 在這~
http://forum.foxera.com/mongodb/topic/512/find-与findone-的差異
表示大家還是不大習慣先搜尋
与 萌阔论坛 的连接断开,我们正在尝试重连,请耐心等待