Skip to main content
Solved

Use mongodb writer to update existing documents

  • February 14, 2017
  • 3 replies
  • 48 views

Forum|alt.badge.img

I can't figure out how to use a mongodb writer to update existing documents (specifically, I want to insert new elements in a list within the existing json structure)

 

 

I don't even see any parameter to set the writer to update or upsert.

Best answer by fmelizard

Turns out we don't have a true update capability yet.

That said, you can use the Mongo reader to pull out the document you want, and then set the writer into PUT mode to put it back in effectively updating the existing one. In the middle you'd have updated your JSON appropriately.

 

The FME 2017 doc has the specs here: http://docs.safe.com/fme/2017.0/html/FME_Desktop_Documentation/FME_ReadersWriters/couchdb/format_parameters_w.htm

If you're still stumped, let us know and we can mock up an example.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

fmelizard
Safer
Forum|alt.badge.img+21
  • Safer
  • Best Answer
  • February 14, 2017

Turns out we don't have a true update capability yet.

That said, you can use the Mongo reader to pull out the document you want, and then set the writer into PUT mode to put it back in effectively updating the existing one. In the middle you'd have updated your JSON appropriately.

 

The FME 2017 doc has the specs here: http://docs.safe.com/fme/2017.0/html/FME_Desktop_Documentation/FME_ReadersWriters/couchdb/format_parameters_w.htm

If you're still stumped, let us know and we can mock up an example.


Forum|alt.badge.img
  • Author
  • February 15, 2017

Turns out we don't have a true update capability yet.

That said, you can use the Mongo reader to pull out the document you want, and then set the writer into PUT mode to put it back in effectively updating the existing one. In the middle you'd have updated your JSON appropriately.

 

The FME 2017 doc has the specs here: http://docs.safe.com/fme/2017.0/html/FME_Desktop_Documentation/FME_ReadersWriters/couchdb/format_parameters_w.htm

If you're still stumped, let us know and we can mock up an example.

Thanks for the input.

 

 

Are there any plans to improve on the mongo compatibility to fit in more of the api tools ? Even mongo shell calls ?

 

 

I will try to compare the performance of this workaround and mine (using a python caller)

 

 


  • March 20, 2018

Hi,

Have you got a visual exemple of updating a mongodb collection with FME 2018 ?

Thanks

Regards