I want to add two JSON objects which have structure like this (It has more data and I ignore them in here):
{ "total_count":100 , "types":20 , { "a" : 5 , "b" : 6 }}
{"total_count" : 1 , { "a" : 2 } }
I want to add these objects in node.js in order to get following object:
{ "total_count":101 , "types":20 , { "a" : 7 , "b" : 6 }}
I use mongodb which has $inc function which add current json to existing one in db and reduce load and store load. I'm interested to find a method which handle this action in nodejs.What should I do ( I dont want to do it manually preferly. instead i like to use existing functions)?