I want to write a validation check where the query should return all users with a given username "OR" a given email. How could I write such a query using the mongo_dart package without having to query all the data and check it manually?
example query: if username=="x" or email=="y"
The tried this using the below query, but it did not work.
List<dynamic> all = await coll2.find({
"or": [
{"username": username},
{"email": email}
]
}).toList();
Moreover, using $or instead of or is raising syntax error in dart.
You can try: