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
- Bulk API limitations in self-hosted serv...
Environment: Appwrite Selfhost SDK: node-appwrite 28.0 Calling `upsertRows` (also applies to `createRows`/`updateRows`/`deleteRows`) with more than 100 rows fa...
- Self Hosted GitHub connection not adding...
After upgrading to 1.9.6 i noticed that i cannot search for new repositories when trying to add new functions. I removed the existing github connection via Set...
- Getting current user has been blocked
Getting current user has been blocked error while signing in the appwrite console. Got this during I am testing with the my saas web project. Please help to unb...