I used Azure DocumentDB to store some Key-Values pairs. This is the structure of the document I used
{
    "Key": "Deleted",
    "Value": {
      "email": "[email protected]"
    }
}
When i write DocumentDB query like this,
SELECT C.Value FROM C
This query does not work. Here is the error message I get.
Syntax error, incorrect syntax near 'Value'.
But this query works fine,
SELECT C.Key FROM C
I understand 'Value' should be a keyword in azure documentdb. How can i query it?
Value is a keyword in DocumentDB syntax so this is why you get an error. See Value keyword in this article DocumentDB syntax - The VALUE keyword provides a way to return JSON value.
To get around this you can query it the way Yannick has said i.e.
SELECT C['Value'] FROM C
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With