Skip to main content

I am working with MongoDB trying to upsert nested MongoDB documents. The JSON format would be something like:

{

“name”: “XXX”,

“tables” : t 

{

“name”: “XXXX”,

“num_rows” : 3423,

“fields”:  

        {“name”: “XXX”, “type”: “yyyy”} , …. 

    ]

}, ….

]

 

I have no problems when I use a JSON string attribute inserting a new document with Document Source”: Json Attribute” and Insert operation.

But, I do need to UPDATE existing features.

In this case, the nested dcouments (tables in the json above) are created as plain strings.  Which is a real inconvenience in my use-case.

{

“name”: “XXX”,

“tables” : u “{“name”: “XXXX”,“num_rows” : 3423,“fields”: /         {“name”: “XXX”, “type”: “yyyy”} , ….     ]} “ , ….

]

Valid datatypes do not currently include arrays (of objects) 

 Is there any alternative or workarounds?

 

 

 

 

 

 

 

 

 

Out of curiosity, what version of FME are you working with? I have been running into similar problems, I will link my post in another comment where I reference a couple old posts relating to mongo arrays. I too have been dealing with the limitation of only using RAW JSON on Insert.


 


Reply