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

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -