moai/luamongo

how to use query where ?

dome opened this issue · 1 comments

dome commented

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);

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}})