I'm trying to use jsonpatch to create new path in a mongoose document, but I can't make it work.
The page oficial page enter link description here says that I can add new values to a path like this,
{op: add, path:/mypath, value: 'new value'}
But what I want is to add new path with new values. I've try passing a variable to the path like this:
var valuesItem = [{
op: 'add',
path: '/' + data,
value: 'data'
}];
But that don't work. Thanks.