Skip to content

Cosmos: Expand checks against null values for nested properties to first check parents for null #17746

@divega

Description

@divega

The full context is described in #13131 about dealing with missing property values. Creating this separate issue to track priorities separately.

In general we have chosen not to equate undefined and null values. Customers using the Cosmos DB provider will need to be aware of how to deal with missing values in their databases.

There is however one specific scenario in which we decided to compensate to make missing values more seamless: We will expand null comparisons for nested properties to compensate. For example, c.Address.City == address will expand to c.Address == null OR c.Address.City == null when address is equal to null. If we don't do this, and c.Address is null, the check for c.Address.City == address will not succeed and the query will not return that row.

Notice that we are not proposing to check for EF.Functions.IsDefined(c.Addresss) but for c.Address == null. That is coherent with not conflating undefined with null values.

A good way to think about this proposal is that we do it to simulate how null propagation would work in many other databases to make the experience more predictable.

cc @AndriySvyryd

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions