0

I would like to check if a field value is equal to a certain String.

I tried this :

DBCursor results = coll.find();
while (results.hasNext()) {
    if ((results.next().get("name").toString()) == "sammy") {
        System.out.print("debug" + (results.next().get("nom").toString()));
    }
}

but it returns me nothing, i don't understand.

Thanks for your help.

Youcef LAIDANI
  • 55,661
  • 15
  • 90
  • 140
user10040
  • 1
  • 1

0 Answers0