mongodb - What is the difference between find({}, {sort: ...}) and find().sort(...)? -
in mongodb documentation, when search sort, direct me cursor.sort() page. (btw documentation doesn't specify returned out of method.). used in meteor script collection.find().sort('date':1)
, got complained find().sort not function. (i thought find()
returns cursor, isn't it?)
so did further search, , found tutorials tell me use find({}, {sort: ...}).
so difference between these 2 methods?
in meteor framework, things need meteor way!
use collection.find
specified in meteor docs, , pass sort specifier.
what difference between two?
1 has been wrapped meteor, , works inside framework, other 1 doesn't!
i don't believe see performance difference between 'the meteor api' in framework, or 'the standard mongodb api' (non meteor) nodejs.
Comments
Post a Comment