Hi, i came across this issue.. https://github.com/appwrite/appwrite/issues/5506
Why cant we have a count variable for every collection in the database? increment it on every document created and decrement on every document deleted.
by this way the "expensive database operation" on count will also be reduced and we will get the exact count of every documents inside the collection.
probably its not suitable for filterQueries but at least we will get an idea on how much documents exists in the collection
The first solution would be to indeed create some counter, and you can let to be trigger on
databases.*.collections.*.documents.*.createdatabases.*.collections.*.documents.*.updateSo you can be sure the counter will be up to date.
Also these feature request https://github.com/appwrite/appwrite/issues/3905 will make it easy in the future.
Also, I remember seeing somewhere the option to have this option embed in the collectin but can seem to find it right now.
right. we recommend having that sort of metadata collection if you need to maintain a count of documents.
How to implement that?
Want to take a guess?
Custom functions?
But it would be good if it was implemented directly with appwrite
I don't think so because it's custom app logic and only for some apps
Recommended threads
- Download appwrite Docs
Is there is a way to download appwrite Docs ? Because appwrite skill isn't enough to give the agent full understanding about how appwrite works (I noticed this ...
- How do you contact support to cancel a s...
My nephew signed up with my CC without my permission and has forgotten the password to the account. I can't for the life of me get a hold of anyone at appwrite....
- Local appwrite run functions --user-id n...
Hi, I'm running into an issue when testing Appwrite functions locally with user impersonation. I'm using a self-hosted Appwrite instance and running functions ...