MongoCollection.updateOne usage for 3.x in java

363 views Asked by At

I need to update One document in MongoCollection 3.x and i am using below mentioned code.

coll.updateOne(eq("name", "frank"), new Document("$set", new Document("age", 33)));

I am getting error message "The method eq(String, String) is undefined.

Please let me know what should be done.

1

There are 1 answers

0
Wizard On

Did you make sure you statically imported the eq() method?