Skip to main content
Question

Writing Geometries to an Attribute in MongoDB3


liamfez
Influencer
Forum|alt.badge.img+34

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

AliAtSafe
Safer
Forum|alt.badge.img+20
  • Safer
  • April 30, 2024

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!


txalaparta
Contributor
Forum|alt.badge.img+3
  • Contributor
  • May 2, 2024

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.

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings