SapphireDb logo SapphireDb

Count data

You can use the count prefilter to count the values of your collection.

Note that the usage of the prefilter types Take, Skip, Select, Count, First and Last will require the collection data to always get queried from the database on every change. Keep that in mind when creating performance critical tasks.
\f:(typescript:Angular) export class DemoComponent implements OnInit {\n \tvalues$: Observable<number>;\n \tconstructor(private db: SapphireDbService) { }\n\n \tngOnInit() {\n \t\tthis.values$ = this.db.collection<Entry>('entries')\n \t\t\t.count()\n \t\t\t.values();\n \t}\n }
null

This website uses Google Analytics. If you want to disable it just unselect the option: