Hi

2017-08-10 13:12 GMT+02:00 John Le Brasseur <johnlebrass...@gmail.com>:
>
> Hi.
> I am trying to create a generic document update handler.
>
> I am using:
>
> function(doc, req) {var field = req.query.field;  var value =
> req.query.value; var message = 'set '+field+' to '+value;  doc[field] =
> value; return [doc, message];  }
>
> This works ok with simple json but not with a nested object such as
> "abc":{"ax":"one", "by":"two" ...}


We use a _very_ stripped down version of lodash as a commonjs module.
lodash provides a set and get function which does what you need.

regards,
Stefan

Reply via email to