DEV Community

[Comment from a deleted post]
Collapse
 
cesarwibaut profile image
César Wibaut

When you type in

db.something.findOne({ registering: { email : 'somethin&something.com' } } );

You're searching any entries that has the registering object that litteraly equals { email : 'something@something.com' }. In your case, registering equals :

{
        "email" : "user@email.com",
        "hash" : "98ebe6bbc1cf207093ca5eeff06a9096",
        "created" : ISODate("2019-10-29T02:16:58.900Z")
}

When you type in { 'registering.email': 'something' } you're searching an entry that have an attribute registering that contains an attribute called email that equals something

Collapse
 
felipperegazio profile image
Felippe Regazio

Perfect. Thanks for your explanation Cesar!