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
- Usage of the new Client() and dealing wi...
Hey guys, just a quick one - we had some web traffic the other day and it ended up bombing out - To put in perspective of how the app works, we have a Nuxt Ap...
- [Beginner] CLI --queries Syntax Error & ...
Hi everyone! I am a beginner with Appwrite and trying to use the CLI, but I'm stuck with a syntax error. Any guidance would be greatly appreciated! 🙏 **Enviro...
- [SOLVED] curl error Number: 6 — function...
Hello, I invested a lot of time in this error in a fresh install of appwrite 1.8.1 and lasted until fix, this if for helping anyone that can have the same weird...