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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -