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

wrong/deprecated code on Docs #344

Open
mertyurt opened this issue Sep 7, 2021 · 0 comments
Open

wrong/deprecated code on Docs #344

mertyurt opened this issue Sep 7, 2021 · 0 comments

Comments

@mertyurt
Copy link

mertyurt commented Sep 7, 2021

https://automattic.github.io/monk/docs/collection/findOne.html
I stumbled upon this just now. when you want to exclude a projection on a query you should use 0 , not -1.

ex.

//wrong use, the one in docs
users.findOne({name: 'foo'}, { projection: {name: -1} }); 

//right one
users.findOne({name: 'foo'}, { projection: {name: 0} }); 
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

1 participant