Back

List documents with query fails with 400

  • 0
  • Databases
  • Web
  • Cloud
Eddie Jaoude | EddieHub
12 Apr, 2024, 08:58

I am not sure why when I add any query to my list documents, it fails with a 400

Works

TypeScript
await new Databases(clientAdmin()).listDocuments(
    process.env.NEXT_PUBLIC_APPWRITE_DATABASE_ID,
    "trending",
    []
  )

Fails 400: message: 'Invalid query: {"method":"limit","values":[10]}',

TypeScript
await new Databases(clientAdmin()).listDocuments(
    process.env.NEXT_PUBLIC_APPWRITE_DATABASE_ID,
    "trending",
    [
      Query.limit(10),
    ]
  )

Package json:

TypeScript
"appwrite": "^14.0.0",
"node-appwrite": "^12.0.1",

Any thoughts appreciated

TL;DR
Developers are encountering a 400 error when adding a query to list documents. Upgrading to version 13.x may resolve the issue as `appwrite: 14.0.0` isn't compatible with Cloud. The problematic query causing the error is `Query.limit(10)`.
darShan
12 Apr, 2024, 08:59

appwrite: 14.0.0 isn't compatible with Cloud.

darShan
12 Apr, 2024, 08:59

try with 13.x.

Eddie Jaoude | EddieHub
12 Apr, 2024, 09:00

oh i see, i thought it might be a version issue. Thank you, i will try it now

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more