Faraz
Faraz

Reputation: 6275

MongoDB import inc

I am following a Java tutorial on MongoDB and I was on this example:

UpdateResult updateResult = collection.updateMany(lt("i", 100), inc("i", 100));

When I try to run it in my IDE, I get an error over inc. It says that The method inc(String, int) is undefined for the type myClassName. How do I import it to my class? I have searched around but no answer.

Thanks

Upvotes: 0

Views: 70

Answers (1)

s7vr
s7vr

Reputation: 75934

Add the static import

import static com.mongodb.client.model.Updates.inc;

to the class.

Upvotes: 1

Related Questions