nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Thomsen <mikerthom...@gmail.com>
Subject Re: Problem with PutMongoRecord.
Date Thu, 16 May 2019 18:13:49 GMT
Seems like a pretty easy fix. I'm not at my desk at the moment, but will
try to write up at least a Jira ticket for this in a bit.

On Thu, May 16, 2019 at 4:22 AM Yves HAMEL <yhamel@macif.fr> wrote:

> Hi,
> I use Put MongoRecord processor to insert documents in a mongodb
> collections.
> Some of the documents have fields that are to set. For exemple :
>      [{"nom":"toto", "prenom":"toto", "date":"01/01/2019"},{"nom":"tata",
> "prenom":"tata"}]
>
> The PutMongoRecord processor use a JsonTreeReader whith the following
> schema
> {
>     "type" : "record",
>     "name" : "Test",
>     "fields" : [ {
>       "name" : "nom",
>       "type" : "string",
>       "doc" : "Type inferred from '\"toto\"'"
>     }, {
>       "name" : "prenom",
>       "type" : "string",
>       "doc" : "Type inferred from '\"toto\"'"
>     }, {
>       "name" : "date",
>       "type" : [ "null", "string" ],
>       "doc" : "Type inferred from '\"01/01/2019\"'",
>       "default" : null
>     } ]
> }
>
> When the documents inserted in the mongodb database are :
>
> {"_id":"5cdd1c3d2df9626a98bff7a8","nom":"toto","prenom":"toto","date":"01/01/2019"}
> {"_id":"5cdd1c3d2df9626a98bff7a9","nom":"tata","prenom":"tata","date":null}
>
> Does anyone know How can I do, so that the PutMongoProcessor insert field
> (date) only if it is set :
>     {"_id":"5cdd1c3d2df9626a98bff7a9","nom":"tata","prenom":"tata"}
>
> Thanks
> Tves HAMEL
>
> Yves HAMEL
>
> Direction Digital & Systèmes d’Information Groupe
>
> LM_DATA
>
> MACIF - 2 et 4, rue Pied de Fond - 79037 Niort cedex 9
>
> Tél. : +33 (0)5 49 09 36 06
>
> Email : mon.email@macif.fr / Pré Doyen 2 – bureau 999
>
> www.macif.fr <https://www.macif.fr/assurance/particuliers> - Appli
> présente sur Google Play Store & Apple Store
>
>
>

Mime
View raw message