My query is as such:
const users = this.mongo.db.collection('Users')
let query = { '$or': [ { "email": {'$eq': req.body.email }}, {"username": {'$eq': req.body.username }} ] }
users.findOne({query}, function(err, result) {
...
Not really sure why it isn't working. To my understanding, this is the correct way of formatting an or?
Wrong at third line {query} => query
db.collection.find({
"$or": [
{
"email": {
"$eq": "222"
}
},
{
"username": {
"$eq": "Tom"
}
}
]
})