
An extremely lightweight plugin that allows developers to seamlessly convert java classes into mongo documents.
An extremely lightweight plugin that allows developers to seamlessly convert java classes into mongo documents.
This plugin is made for Java Developers who are looking to use MongoDB as their database storage rather than local yml files.

Lead among other various plugins I have worked on are free to use!
Please consider donating to my ko-fi! It helps fund other projects that I am passionate about.
Knowledge Book uses https://mongojack.org/ as its main api to help convert java classes to mongo documents. All Knowledge Book does is allow developers to seamlessly integrate this into your plugins.
package gg.lode.example.data;
import com.fasterxml.jackson.annotation.JsonProperty;
import to.lodestone.knowledgebook.annotation.Collection;
@Collection(name = "person_collection")
public class Person {
@JsonProperty("fullName")
private String fullName;
@JsonProperty("socialSecurityNumber")
private String socialSecurityNumber;
// For Knowledge Book to initialize an empty object to use getters and setters.
public Person() {
}
public Person(String fullName, String socialSecurityNumber) {
this.fullName = fullName;
this.socialSecurityNumber = socialSecurityNumber;
}
@JsonProperty("fullName")
public void setFullName(String fullName) {
this.fullName = fullName;
}
@JsonProperty("fullName")
public String getFullName() {
return fullName;
}
@JsonProperty("socialSecurityNumber")
public void setSocialSecurityNumber(String socialSecurityNumber) {
this.socialSecurityNumber = socialSecurityNumber;
}
@JsonProperty("socialSecurityNumber")
public String getSocialSecurityNumber() {
return socialSecurityNumber;
}
}
package to.lodestone.example;
import org.bukkit.plugin.java.JavaPlugin;
import org.mongojack.JacksonMongoCollection;
import gg.lode.example.data.Person;
import to.lodestone.knowledgebook.IKnowledgeBookAPI;
import to.lodestone.knowledgebook.KnowledgeBookAPI;
public class TestPlugin extends JavaPlugin {
@Override
public void onEnable() {
JacksonMongoCollection<Person> personCollection = this.kbHook.api().getOrCreateCollection(Person.class);
personCollection.insertOne(new Person("John Doe", "4355678656"));
}
public IKnowledgeBookAPI knowledgeBook() {
return KnowledgeBookAPI.getApi();
}
}
person_collection with a new Person document with all of the data you've provided.
database: null
connectionString: null