PutMongo 1.3.0 - Upsert issue

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

PutMongo 1.3.0 - Upsert issue

fabe_bdx
Hi All,

We actually used nifi 1.3.0, with a PutMongo 1.3.0 processor, we have an
issue with the upsert capabilities of this processor.

During the Upsert if an attribute of the document is not present in the
request from putmongo, the processor suppress it the mongo document
collection.

We don"t find any solution to this problem for 1.3.0 version, but that seem
to be resolved in the 1.5.0.

Is it possible to apply a patch to 1.3.0 version to solve this problem ?

Many thanks for your help.

Fabien.



--
Sent from: http://apache-nifi-developer-list.39713.n7.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: PutMongo 1.3.0 - Upsert issue

Pierre Villard
Hi,

Easiest solution is probably to build the Mongo NAR with 1.5.0 code, and
drop it into your NiFi 1.3. This way you'll have the two versions of the
processor available in NiFi and you can easily switch from one version of
the processor to another.

https://nifi.apache.org/docs/nifi-docs/html/user-guide.html#component-versioning

Thanks
Pierre

2018-01-09 16:00 GMT+01:00 fabe_bdx <[hidden email]>:

> Hi All,
>
> We actually used nifi 1.3.0, with a PutMongo 1.3.0 processor, we have an
> issue with the upsert capabilities of this processor.
>
> During the Upsert if an attribute of the document is not present in the
> request from putmongo, the processor suppress it the mongo document
> collection.
>
> We don"t find any solution to this problem for 1.3.0 version, but that seem
> to be resolved in the 1.5.0.
>
> Is it possible to apply a patch to 1.3.0 version to solve this problem ?
>
> Many thanks for your help.
>
> Fabien.
>
>
>
> --
> Sent from: http://apache-nifi-developer-list.39713.n7.nabble.com/
>
Reply | Threaded
Open this post in threaded view
|

Re: PutMongo 1.3.0 - Upsert issue

fabe_bdx
Thanks for the repply, but i don't have any knowledge to complile NAR object
:/

is it possible to extract them of 1.5.0 and push it into nifi 1.3.0 directly
?

Thx,



--
Sent from: http://apache-nifi-developer-list.39713.n7.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: PutMongo 1.3.0 - Upsert issue

Pierre Villard
Yes, if you have a running 1.5.0-SNAPSHOT NiFi running, then you could get
the NAR from the lib directory and just drop it into the directory in your
1.3 instance. Note that it's not recommended to put custom NARs into the
lib directory. Best is to define an external directory for custom NARs in
nifi.properties and drop your files in there. Note that you'll need to
restart NiFi.

If you don't have a NiFi 1.5.0-SNAPSHOT running, then you could use the
current release candidate, and follow the below process:

# Pull down nifi-1.5.0 source release:
https://dist.apache.org/repos/dist/dev/nifi/nifi-1.5.0/nifi-
1.5.0-source-release.zip

# Unzip nifi-1.5.0-source-release.zip

# Build the sources
cd nifi-1.5.0
mvn clean install -DskipTests

Pierre


2018-01-09 17:24 GMT+01:00 fabe_bdx <[hidden email]>:

> Thanks for the repply, but i don't have any knowledge to complile NAR
> object
> :/
>
> is it possible to extract them of 1.5.0 and push it into nifi 1.3.0
> directly
> ?
>
> Thx,
>
>
>
> --
> Sent from: http://apache-nifi-developer-list.39713.n7.nabble.com/
>
Reply | Threaded
Open this post in threaded view
|

Re: PutMongo 1.3.0 - Upsert issue

fabe_bdx
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/