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

i cann't query.have problem. #24

Closed
tomanupong opened this issue Mar 30, 2020 · 3 comments
Closed

i cann't query.have problem. #24

tomanupong opened this issue Mar 30, 2020 · 3 comments

Comments

@tomanupong
Copy link

tomanupong commented Mar 30, 2020

Hi neoxic. I ahve problem.Iwant query this .
mongo shell i want.
db.test.find({"$and":[{"num":{"$exists":true}},{"num":{"$nin":[0]}}]}).sort({num:1}).limit(1)
i try query in
local query_max = mongo.BSON('{"$and":[{"num":{"$exists":true}},{"num":{"$nin":[0]}}]},{"limit":5}')

for select_data in collection:find(query_max):iterator() do
            print(select_data.num)
  end

respon = {}
help pls neoxic.I think syntax me error.but i don't know guy.
thank you.

@neoxic
Copy link
Owner

neoxic commented Mar 30, 2020

Have you checked the README and the Reference? Have you looked at the tests as an example? Because your syntax is incorrect.

@tomanupong
Copy link
Author

sorry. code this example guy.
collections test is for example .
i read README. i just want use $and in mongo.BSON .

@tomanupong
Copy link
Author

thank you neoxic. i got it.
Sorry i'm wrong.
{"$and":[{"num":{"$exists":true}}]}

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