cosmosdb-query icon indicating copy to clipboard operation
cosmosdb-query copied to clipboard

OFFSET & LIMIT not supported

Open asleire opened this issue 5 years ago • 3 comments

Attempting to execute the following query

SELECT VALUE root
FROM root
WHERE (root["value"] = "value2")
OFFSET 0 LIMIT 1

will throw the following exception

{
  "message": "Expected \"!=\", \"%\", \"&\", \"*\", \"+\", \"-\", \"--\", \".\", \"/\", \"<\", \"<<\", \"<=\", \"<>\", \"=\", \">\", \">=\", \">>\", \">>>\", \"?\", \"??\", \"AND\", \"BETWEEN\", \"IN\", \"OR\", \"ORDER\", \"[\", \"^\", \"|\", \"||\", [ \\t\\n\\r], or end of input but \"O\" found.",
  "expected": [], // omitted for brevity
  "found": "O",
  "location": {
    "start": {
      "offset": 61,
      "line": 4,
      "column": 1
    },
    "end": {
      "offset": 62,
      "line": 4,
      "column": 2
    }
  },
  "name": "SyntaxError"
}

asleire avatar May 09 '20 20:05 asleire

did you ever figure this out? I have the same issue

elbasan avatar Feb 17 '22 12:02 elbasan

I was trying to use this in order to run automated integration tests in a linux environment without setting up a real cosmos database. Unfortunately I gave up since I faced too many quirks. Fortunately Microsoft now supports running the CosmosDB Emulator in Docker for Linux! https://docs.microsoft.com/en-us/azure/cosmos-db/linux-emulator?tabs=ssl-netstd21

asleire avatar Feb 17 '22 13:02 asleire

I'm trying to run integration tests as well with jest, I guess that the created databases do not support offset & limit. Too bad

but thanks for the link!

elbasan avatar Feb 17 '22 13:02 elbasan