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
Let us say, we have 1000 records, and I want to fetch latest 100 records by timestamp.
when i use local r = col:find(criteria,nil,100) r:sort({["timestamp"]=-1})
the cursor return sorted result of first 100 results.
what I want is sort 1000 records first, and then limit 100 records.
The text was updated successfully, but these errors were encountered:
it is a bug. you can modify this file src/cursor.lua in line 42:
function cursor_methods:limit(n) assert(n) self.limit_n = n return limit end
modify
return limit
to
return self
Sorry, something went wrong.
then use like this
r:sort({["timestamp"]=-1}):limit(100)
No branches or pull requests
Let us say, we have 1000 records, and I want to fetch latest 100 records by timestamp.
when i use
local r = col:find(criteria,nil,100)
r:sort({["timestamp"]=-1})
the cursor return sorted result of first 100 results.
what I want is sort 1000 records first, and then limit 100 records.
The text was updated successfully, but these errors were encountered: