0

I'm playing around with mongodb (documentation isn't very complete):

tmpQuery = collection.find({"title_full": "kdsljfklsadfklj"})
print tmpQuery[0]['title_full']

That just echo's "no such item for Cursor instance", what is an if statement to determine if the variable tmpQuery has a valid result set and not empty?

1 Answer 1

4

oh geez, issue solved with:

tmpQuery.count()
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.