Skip to content

GROUP BY #97

@stuatnimble

Description

@stuatnimble

Having trouble with GROUP BY in a query.

Query

const { resources } = await myContainer.items
    .query({
      query:
        'SELECT MAX(t.inc) AS inc FROM t WHERE t.userId=@userId GROUP BY t.orgId',
      parameters: [
        {
          name: '@userId',
          value: userId,
        },
      ],
    })
    .fetchAll();

Error

The above works just fine using a real Cosmos NoSQL server, but errors with this one with the following...

Error: Expected "!=", "%", "&", "*", "+", "-", "--", ".", "/", "<", "<<", "<=", "<>", "=", ">", ">=", ">>", ">>>", "?", "??", "AND", "BETWEEN", "IN", "OR", "ORDER", "[", "^", "|", "||", [ \t\n\r], or end of input but "G" found.

Versions

"@vercel/cosmosdb-server": "^0.14.0",
"@azure/cosmos": "^3.17.3",
Node: 18.12.1

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions