We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cursor:limit(6) local sort_res = cursor:sort({startTime=-1}}, 1000)
当最大条目小余limit值,最开始的几条数据不会返回~~这个是怎么回事?
比如最大条目是7,limit为10,则全部返回,limit为5,则最大的两条不会返回
The text was updated successfully, but these errors were encountered:
我又查了下底层lua部分,貌似没有实现sort的命令?
Sorry, something went wrong.
找到了一种方式,用db.collection.find( { $query: {}, $orderby: { age : -1 } } )
但是mongodb3.2版本以后就不支持了~ https://docs.mongodb.com/manual/reference/operator/meta/orderby/
确实是用db.collection.find( { $query: {}, $orderby: { age : -1 } } ) 这种方式才有效。limit+sort的问题太多了。
No branches or pull requests
cursor:limit(6)
local sort_res = cursor:sort({startTime=-1}}, 1000)
当最大条目小余limit值,最开始的几条数据不会返回~~这个是怎么回事?
比如最大条目是7,limit为10,则全部返回,limit为5,则最大的两条不会返回
The text was updated successfully, but these errors were encountered: