我正在尝试通过以下方式使用限制和和尚api中的排序:
db.user.find({ changesId : '1234' }, { limit :4 , sort : { name : 1 } }, function (err,res) {
});
在这种情况下,排序似乎不起作用。我究竟做错了什么?
您的代码不正确-}
丢失。正确的:
db.user.find({ changesId : '1234' },
{ limit : 4, sort : { name : 1 } }, // <- here
function (err,res) { });
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句