Mongo _id kettle

I'm trying to take a breath using the _id field in Mongo.

I tried to restore the _id first using the Json input step, no luck with $ ._ id or $ ._ id. $ oid

Does anyone know how to upsert from _id?

+3


source to share


1 answer


Once you have the _id, convert it to extended JSON notation as denoted by Stennie with a Modified Javascript Value

script like:

var _id = '{ "$oid": "' + _id + '" }';

      



In step, MongoDB Output

set column JSON

to Y

for row _id

. I'm not sure when this JSON variant was introduced, but found it in the latest CI Kettle build today.

+2


source







All Articles