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' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -