Dexels / navajo

Navajo Service-oriented Applications
GNU Affero General Public License v3.0
9 stars 5 forks source link

(Mongo) Function MongoUpdateProperty results in unwanted side-effect #576

Open kharybdys opened 3 years ago

kharybdys commented 3 years ago

If you're using MongoUpdateProperty to update a message that represents a Mongo document in the database (eg the MatchForm collection), it results in not just updating the property but also adding an __id property if it doesn't exist yet. This property should only exist within elements of an array so it's unwanted.

First analysis is that this is due to the way MongoUpdateProperty retrieves the message(s) to change. That makes the message type "array_element" and that ensures the MessageCodec adds the __id property.

kharybdys commented 3 years ago

The __id property generated isn't causing any problems, it just looks odd. So urgency is low.