Answer the question
In order to leave comments, you need to log in
How to get key value?
I get the user from the database:
Document document = Main.getPlugin(Main.class).getPlayersDataCollection().find(Filters.eq("nickname", p.getName())).first();
if (document.getString()) {
document.replace("titleOff", false);
}
if (!document.getBoolean("titleOff")) {
document.replace("titleOff", true);
}
Main.getPlugin(Main.class).getPlayersDataCollection().replaceOne(Filters.eq("nickname", p.getName()), document, new UpdateOptions().upsert(true));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question