Back

Queries broke...

  • 1
  • Web
Hexi
23 Aug, 2024, 15:10

So I am using an query to search more affectively to the right places but the startswith query suddenly broke:

TypeScript
[
  '{"method":"equal","attribute":"lister","values":["663fa5de5184c90188a3"]}',
  '{"method":"orderDesc","attribute":"$createdAt"}',
  '{"method":"startsWith","attribute":"$createdAt","values":["2024-08-"]}',
  '{"method":"limit","values":[5000]}'
]
C:\vectra\Vectra-Back\node_modules\node-appwrite\dist\client.js:275
      throw new AppwriteException(data == null ? void 0 : data.message, response.status, data == null ? void 0 : data.type, data);    
            ^

AppwriteException: Invalid query: Query value is invalid for attribute "$createdAt"
    at _Client.call (C:\vectra\Vectra-Back\node_modules\node-appwrite\dist\client.js:275:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Databases.listDocuments (C:\vectra\Vectra-Back\node_modules\node-appwrite\dist\services\databases.js:1577:12)
    at async getOrdersChart (C:\vectra\Vectra-Back\lib\appwrite.js:259:16)
    at async handler (C:\vectra\Vectra-Back\routes\dashboard\stats.js:43:45) {
  code: 400,
  type: 'general_query_invalid',
  response: {
    message: 'Invalid query: Query value is invalid for attribute "$createdAt"',
    code: 400,
    type: 'general_query_invalid',
    version: '1.5.7'
  }
}

I am on Version 1.5.7.

It happens at query: '{"method":"startsWith","attribute":"$createdAt","values":["2024-08-"]}',

TL;DR
Developers using a query for searching encountered a problem where the 'startsWith' query broke specifically at the point: `'{"method":"startsWith","attribute":"$createdAt","values":["2024-08-"]}',`. The error indicates "Invalid query: Query value is invalid for attribute "$createdAt"." This issue was encountered on version 1.5.7.
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