Back

delete with query

  • 0
  • Databases
Mickaël LT
17 May, 2023, 10:20

Hi, Is there a way to delete any documents in a collection by a query (like listDocuments) ?

like this :

final documents = await databases.deleteDocuments( databaseId: dbId, collectionId: collectionId, queries: [ Query.equal('user', userId), ], );

TL;DR
The user wants to know if it's possible to delete documents in a collection using a query. The response suggests that it is not currently possible and that the user would need to make two separate requests - one to query for the documents and another to delete them.
Vedsaga
17 May, 2023, 10:20

hi nope, not possible at this momenent. you might need to make 2 request

Vedsaga
17 May, 2023, 10:21

first, to get all doc via query which match the conditon and then send another req for deleteing

Binyamin
17 May, 2023, 11:29

I don't see any issue ( feature request ) for that, I suggest you create one

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