Query for the User

Which of these queries can be used If you want to find all MongoDB users who do not have the username “John”?

Options
1.db.users.find({"username" : {"$ne" : "John"}})
2.db.users.find({"username" : {"$not" : "John"}})

3.db.users.find({"username" : {"$else" : "John"}})

4.db.users.find({"username" : {"$except" : "John"}})

Related Posts