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

suggestion for query simplification #30

Open
colwilson opened this issue Jun 12, 2012 · 1 comment
Open

suggestion for query simplification #30

colwilson opened this issue Jun 12, 2012 · 1 comment

Comments

@colwilson
Copy link

Would it not be better to let this work:

books = Book.query.filter(Book.author == author).first()

rather than:

books = Book.query.filter(Book.author.mongo_id == author.mongo_id).first()
@AndySum
Copy link

AndySum commented Nov 15, 2013

I just stumbled across this issue with my project as well.

I tried the above method you suggested, and it actually worked sporadically for my queries. It would work on localhost, but not on Heroku, both with the same shared database.

When I switched to the second method (as it seems you have to), it started working the same on both systems.

It would be good to have an example on this at the very least, but I agree with your suggested simplification.

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