Find some values in a mongodb collection?
问题 Im trying to read a (mongo)userdatabase with java. On the tutorial page I saw how to read the whole collection. I can do something like that: DBCursor cursor = col.find(); while (cursor.hasNext()) { System.out.println(cursor.next()); } Now if I have a collection with users := name, age, password (...) and whatever. Now I would like to find a name with a password. For example for a login process. Lets say I have two strings: String n and p. If there is a user.equals(n) and a password.equals(p)