Using reserved word field name in DocumentDB

前端 未结 1 2003
再見小時候
再見小時候 2020-12-19 04:25

I inherited a database loaded into DocumentDB, where field name happens to be \"Value\". Example of my structure is:

{
...
   \"Alternates\": [
      \"Type\         


        
相关标签:
1条回答
  • 2020-12-19 05:15

    You are correct. Value is a reserved keyword. To escape this use [""] syntax.

    So in your case of

    "Alternates": [ "Type": "ID", "Value" : "NOCALL" ]

    SELECT c FROM c JOIN alt IN c.Alternates WHERE alt["Value"] = 'NOCALL'

    0 讨论(0)
提交回复
热议问题