Skip to main content
Solved

Use mongodb writer to update existing documents

  • February 14, 2017
  • 3 replies
  • 27 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.

View original
Did this help you find an answer to your question?

3 replies

fmelizard
Contributor
Forum|alt.badge.img+17
  • Contributor
  • 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
fmelizard wrote:

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


Reply


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