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.*.create
databases.*.collections.*.documents.*.update
So 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
- Having issues with login via CLI
``` ~/appwrite appwrite login --endpoint https://localhost/v1 --verbose ? Enter your email myvalidemai...
- Attributes Confusion
```import 'package:appwrite/models.dart'; class OrdersModel { String id, email, name, phone, status, user_id, address; int discount, total, created_at; L...
- I recently applied for the free plan und...
I recently applied for the free plan under the GitHub Student Developer Pack. However, my billing status still shows $15, and it mentions that this amount will ...