MongoCollection.updateOne usage for 3.x in java

376 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 best solutions below

0
On

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