Skip to content
New issue

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

how to use query where ? #17

Closed
dome opened this issue Apr 1, 2012 · 1 comment
Closed

how to use query where ? #17

dome opened this issue Apr 1, 2012 · 1 comment

Comments

@dome
Copy link

dome commented Apr 1, 2012

i use sort in query object it's work fine. but i need to to know how to add where?
sort = {}
sort['utime']=-1;
q1,err = mongo.Query.New()
ok,err = q1:sort(sort)

------ sone thing like that ----
twhere = {}
ok,err = q1:where(twhere);

@larubbio
Copy link
Contributor

This should really be asked on the luamongo group (luamongo@googlegroups.com) You can do a query with a sort and a filter like this:

mongo:find("collection", {query = {field = value}, orderby = {field = 1}})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants