MongoDB Java - How to assign variables from a document -
is there way store variable document in mongodb? have document:
{ "math" : { "variableone" : 3, "variabletwo" : 4, } }
i assign data int variables , add 2 , print out sum.
a simple way write class represents document:
public class math { private int variableone; private int variabletwo; //getters & setters }
you can use jackson here convert document string object of class math.
Comments
Post a Comment