The CollectionGroupService is a simple service to sync a store with a collection group.
@Injectable({ providedIn: 'root' })
export class MovieService extends CollectionGroupService<MovieState> {
collectionId = 'movies';
constructor(store: MovieStore) {
super(store);
}
}This service provides readonly methods only as CollectionGroup cannot be updated. For more interactive operation use
CollectionService.
collectionId: stringThe id of the collection group you want to sync with. This value is mandatory.
syncCollection(query?: QueryGroupFn);Sync the collection group query with the store.
getValue(query?: QueryGroupFn): Promise<E[]>Get a snapshot of the collection group query.