BHoM / Mongo_Toolkit

GNU Lesser General Public License v3.0
2 stars 3 forks source link

Add upsert push functionality #159

Closed jamesramsden-bh closed 2 years ago

jamesramsden-bh commented 2 years ago

Implement upsert functionality for pushType==UpdateOrCreateOnly

The __Tag__ is used to match documents.

Mongo includes upsert functionality so should be relatively easy to implement: https://www.mongodb.com/docs/manual/reference/method/db.collection.update/

Verify behaviour from the above method once implemented. I'd expect the 'update' aspect of the method to never erase existing fields in the document - will be good to verify what actually happens.