Events
Get certified in Microsoft Fabric—for free!
19 Nov, 11 pm - 10 Dec, 11 pm
For a limited time, the Microsoft Fabric Community team is offering free DP-600 exam vouchers.
Prepare nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
APPLIES TO: NoSQL
Equality and comparison operators in Azure Cosmos DB for NoSQL check two different expressions for equivalency or compares both expressions relationally.
The following table shows the result of equality comparisons in the API for NoSQL between any two JSON types.
Undefined | Null | Boolean | Number | String | Object | Array | |
---|---|---|---|---|---|---|---|
Undefined | Undefined | Undefined | Undefined | Undefined | Undefined | Undefined | Undefined |
Null | Undefined | Ok | Undefined | Undefined | Undefined | Undefined | Undefined |
Boolean | Undefined | Undefined | Ok | Undefined | Undefined | Undefined | Undefined |
Number | Undefined | Undefined | Undefined | Ok | Undefined | Undefined | Undefined |
String | Undefined | Undefined | Undefined | Undefined | Ok | Undefined | Undefined |
Object | Undefined | Undefined | Undefined | Undefined | Undefined | Ok | Undefined |
Array | Undefined | Undefined | Undefined | Undefined | Undefined | Undefined | Ok |
For comparison operators such as >
, >=
, !=
, <
, and <=
, comparison across types or between two objects or arrays produces undefined
.
If the result of the scalar expression is undefined
, the item isn't included in the result, because undefined
doesn't equate to true
.
For example, the following query's comparison between a number and string value produces undefined
. Therefore, the filter doesn't include any results.
SELECT
*
FROM
products p
WHERE
0 = "true"
Events
Get certified in Microsoft Fabric—for free!
19 Nov, 11 pm - 10 Dec, 11 pm
For a limited time, the Microsoft Fabric Community team is offering free DP-600 exam vouchers.
Prepare now