Skip to main content

Hello,

I am having problems with Mongo reader/writer. First I read from Mongo, it works fine and I add several transformers (Clipper, spatialFilter - comparing with other datasets) and then I want to write back to mongo. When I check the output from the Data Inspector, it seems to be fine, geometry is the way I expected and the result looks good. But the Mongo Writer gives back the original geometry.

in writer settings, I put "Document Source":JSON Attribute -> mongodb_json

Thanks!

Hi @johannafalkenst,

Please change the Document Source to Feature. It is the feature that has been modified by the transformers, while the json attribute contains the original geometry.


Hi @johannafalkenst,

Please change the Document Source to Feature. It is the feature that has been modified by the transformers, while the json attribute contains the original geometry.

hi @DaveAtSafe

 

Thanks for your answer. I tried to change it to Feature, but then I lose the information from the original mongo features.

Could it be containing a format attribute with the type of geometry?

If reader and writer have the same format, the writer gives a higher priority to format attributes and if that contained type it will remain the original geometry type instead of the converted geometry.

The quick solution would be using the BulkAttributeRemover removing all format attributes using 'mongodb_*' to be removed.

Hope this helps.


hi @DaveAtSafe

 

Thanks for your answer. I tried to change it to Feature, but then I lose the information from the original mongo features.
Hi @johannafalkenst,

 

Would you mind sharing your workspace with me? It would help me better understand the problem you are seeing.

 


@DaveAtSafe I can now share my workspace. question-fme-hub.fmw

So the goal is to keep the attributes as in: "lines with attributes coming from Mongo* see example" (The structure looks similar to this: image-1.png)

and use the changed geometry from the FME transformation.

Thank you


Hi @johannafalkenst,

 

Would you mind sharing your workspace with me? It would help me better understand the problem you are seeing.

 

@DaveAtSafe I attached my workspace in the answer above. Could you maybe have a look at it?

I still have to deal with the same problem...


Hi @johannafalkenst,

Please edit the properties on the at_vie_all_tmp4 feature type and expose the format attribute mongodb_id.

In the properties for the output feature type test_, set the Parameter Document ID Attribute to mongdb_id. You may also need to set the Geometry field name to 'geometry'.


Reply