moai / luamongo

Lua driver for mongodb
https://github.com/moai/luamongo
MIT License
170 stars 58 forks source link

how to use query where ? #17

Closed dome closed 12 years ago

dome commented 12 years ago

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 commented 12 years ago

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