-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Cosmos: allow excluding null values from Json document #26981
Comments
@aligunel |
Problem is I want "age" in the cosmos db document if value only exists. [Notmapped] attribute will ignore it even there is a data for the field. |
@aligunel I don't think that is supported. |
I think EF COre 6 for Cosmos db is very immature. No support for JsonSerialization options. I need to define ToJsonProperty() for each property. It is not easy to integrate to existing cosmos db. |
Consider moving Consider also enabling this for navigations. Consider adding Note that queries using these properties need to compensate for the default value is it's not just a simple projection. In cases where it's impossible to produce a compensating SQL we need to at least produce a warning. |
To continue @AndriySvyryd's comment above, we should carefully consider the interaction of this client-side default mechanism with the existing "sentinel value" mechanism we already have, which is about detecting when the user has set a property and when they haven't (e.g. for not sending a property to the database to allow it to get generated there). Keep in mind that relational also has JSON mapping, where all of the same considerations apply as for non-relational JSON document databases. /cc @damieng |
Related to #21006 |
When using
This still will create null when saving data in Cosmos Db
or is there anyway to prevent this ?
This issue tracker is for documentation
For product issues, use https://github.com/aspnet/EntityFramework/issues
The text was updated successfully, but these errors were encountered: