nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yves HAMEL <yha...@macif.fr>
Subject Problem with PutMongoRecord.
Date Thu, 16 May 2019 08:22:19 GMT
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