Skip to content

wrong/deprecated code on Docs #344

@mertyurt

Description

@mertyurt

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions