It need be _id. In case of it being generated automatically, it will be
tough to keep track. It can be any valid MongoDB filter query, if I’m
right. So the query should be:
{
<FILTER>,
“$set” : {
“FieldA” : “New FieldA value”
}
}
On Fri, 16 Mar 2018 at 5:07 PM, Mike Thomsen <mikerthomsen@gmail.com> wrote:
> I noticed that your update document didn't have an update key in it. The
> default lookup key is _id so you'd need something like this:
> {
> "_id": "ID_HERE",
> "$set": {
> "new_field": 1
> }
> }
>
> On Wed, Jan 10, 2018 at 6:05 AM, fabe_bdx <fmousnier@gertrude.fr> wrote:
>
> > Dear Pierre,
> >
> > First all many thnaks for your help, we were able to use the copy you
> > provided us and restart Nifi with 1.5.0 module.
> >
> > But it's appear that don't realy work like expected.
> >
> > If we try to update some attributes with the $set commant it don't work.
> >
> > *Original MongoDb record :*
> >
> > {
> > "_id" : ObjectId("5a535bcea33116f026ef65f0"),
> > "type" : "Cc",
> > "nmess" : 3172,
> > "idgtr" : "C-00000-0000-00061-0000-00000-CMF-RMF",
> > "zone" : 1.0,
> > "idzone" : "NULL",
> > "cmf" : 24,
> > "rmf" : 24,
> > "carrefour" : 61,
> > "idcarrefour" : 2,
> > "last_update" : "2018-01-09T13:49:58",
> > "libelle" : " Henrique#Cebolas ",
> > "geojson" :
> > "{\"features\":[{\"geometry\":{\"coordinates\":[\"-9.
> > 132289080874671\",\"38.70801111111111\"],\"type\":\"
> > Point\"},\"type\":\"Feature\"}],\"type\":\"FeatureCollection\"}",
> > "positionOk" : true,
> > "orientation" : 0
> > }
> >
> > *Update request throw putmongo processor :*
> >
> > {
> > "$set": {
> > "type":"Cc",
> > "nmess":14488,
> > "idgtr":"C-00000-0000-00088-0000-00000-CMF-RMF",
> > "last_update":"2018-01-10T09:32:35",
> > "libelle":"Bonifacio_Estefan. "
> > }
> > }
> >
> >
> >
> >
> > --
> > Sent from: http://apache-nifi-developer-list.39713.n7.nabble.com/
> >
>
|