Peter
Peter

Reputation: 173

Azure DocumentDB Null Handling

I have started working with Microsoft's NoSQL services on Azure. One thing that came up was the aspect of how to exclude null based values from updating/saving operations. I haven't found anything explicit to how a null based value can be excluded from the JSON serialization if it is null. So if anyone knows how to do this I'd like to know.

Peter

Upvotes: 1

Views: 476

Answers (1)

Peter
Peter

Reputation: 173

OK; digging the the API I found that the DocumentClient operations are using NetwonSoft. NewonSoft has attributes that can identify if a null value is to be included within the serialization, JsonProperty/NullValueHandling. The intersting thing I found was that in update operations - if a value is not in the JSON results -- the resultant document will have the value removed (if it is there). Not what I was expecting.

Upvotes: 1

Related Questions