Question

Writing Geometries to an Attribute in MongoDB3

  • 26 April 2024
  • 2 replies
  • 19 views

Userlevel 4
Badge +13

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


2 replies

Userlevel 1
Badge +9

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!

Badge +2

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