How could query multiple value in one collection?
const user = db.collection('users').findOne({ username: 'john' })
const user = db.collection('users').findOne({ email: '[email protected]' })
Below are some dummy data. i hope could query name john and email docs in one line of code.
[{id:1, username: 'john', email: '[email protected]'},{id:2, username: 'kelvin', email: '[email protected]'}, {id:3, username: 'angle', email: '[email protected]'}]
Return Data Are: only id: 1 and 2. becasue they match the query
[{id:1, username: 'john', email: '[email protected]'},{id:2, username: 'kelvin', email: '[email protected]'}]