Skip to main content

I have a complicated collection of features stored in mongo db, where a given feature may have multiple unique geometries stored as individual arrays. I would like to use the “Put” Operation in the writer to replace specific features. However when I write to mongo I get two different results (see screenshots of dummy feature with just one example geometry).

location.coordinates{} attribute type set to string
location.coordinates{} attribute type set to double

The desired outcome would look like this:

Referencing other community posts on related matters:

After reviewing those other community posts I think I am going to need an alternative method to what I had started to develop. But I wanted to see if anyone had any ideas or experience with mongo writers to say otherwise.
Thanks

Hi, @liamfez.

I have a suggestion/idea I can share. There is an article that discusses writing structured JSON data, Writing JSON with the JSONTemplater; it shows how to create a JSON template(s) from JSON data and write it out to a Text File Writer (may work with the MongoDB Writer).

There is also a similar, in context, question (older version of FME Form) that a user asks how to write an array of objects to MongoDB via the MongoDB Writer.

Let me know if you need further assistance. Glad to help!


I am currently working with Desktop 2022.2

I´ve gone through the links you mention in the reply and I actually use the JSON templater to build the plain JSON for the insert.

Thanks anyway.

 


Reply