2011-11-03 29 views
3

繼遊離鹼docs on Envelope Parameters,運行的遊離鹼 「鍵光標是一個保留字」

{ 
    "cursor":true, 
    "query":[{ 
    "type":"/music/album", 
    "artist":"The Police", 
    "name":null, 
    "limit":10 
    }] 
}​ 

results in error"Key cursor is a reserved word"@Domenic notes

怎麼回事?


編輯1

所以this query without a cursor worksthis one doesn't因爲cursor was a variable name not a string enclosed in quotes

它是有意義的鍵入破版"cursor"因爲the read parameter type table既有query"cursor"type: string,並且query錯誤了,如果你放在引號爲"query"

然而,即便是在引號引起"cursor"用戶仍然不起作用:它會爲每個查詢生成相同的數據。

+0

您提供的鏈接將導致查詢編輯器中此查詢的工作版本。您是在查詢編輯器中還是通過直接調用APIO得到這個錯誤? –

+0

兩個具有完全相同的查詢,在發佈時都沒有工作。很高興知道這些文檔是正確的,它現在正在工作。如果它再次發生,我會截圖。 –

+0

Re:編輯1 - 第一個請求應該是mqlread?cursor =&query = [{...}]。這將返回結果中的查詢值,然後您的下一個請求將看起來像mqlread?cursor = eNo10UlqAzEQBdALCVxz1e ...&query = [{...}] –

回答

1

看起來這可能是查詢編輯器太聰明並且爲我們修復事情的另一種情況。如果您複製並粘貼上面的查詢到查詢編輯器,按運行爲你報道,你會得到這個錯誤:

{ 
    "code":   "/api/status/error", 
     "messages": [{ 
    "code": "/api/status/error/mql/type", 
    "info": { 
     "expected_type": "/type/object", 
     "property":  "cursor" 
    }, 
    "message": "Key cursor is a reserved word", 
    "path": "", 
    "query": { 
     "cursor":  true, 
     "error_inside": ".", 
     "query": [{ 
     "artist": "The Police", 
     "limit": 10, 
     "name": null, 
     "type": "/music/album" 
     }] 
    } 
    }], 
    "status":  "200 OK", 
    "transaction_id": "cache;cache03.p01.sjc1:8101;2011-11-04T17:42:13Z;0057" 
} 

不過,如果你點擊固定鏈接到查詢它,它改變了這個查詢和自動將遊標屬性設置爲true。

[{ 
    "type": "/music/album", 
    "artist": "The Police", 
    "name": null, 
    "limit": 10 
}]​ 

這是因爲MQL閱讀服務預計將嵌套查詢中的query envelope內,但在查詢編輯器只需要你給它的查詢,並自動將其包裝在一個適當的查詢信封給你的。

MQL read service的新版本中,我們廢除了查詢包絡,現在光標只是HTTP GET請求中的一個參數。

+0

查詢編輯器:絕對正確。很顯然,我的掃描閱讀能力需要改進。 –