I want to create a query that will increment a counter in an object inside an array, but in case the object does not exist - it will be created (upsering)
example:
{
'_id' : 'someId',
someArray : [..,{'name':'a', 'count':234},..],
...
}
how will an upsert of the object {'name' : 'b'} will look like?
I'm using Node.js for the server side if that matter.