Skip to content

Instantly share code, notes, and snippets.

@wovalle
Last active January 20, 2022 20:50
Show Gist options
  • Save wovalle/7b47c19df2d1e994d59158072a27be55 to your computer and use it in GitHub Desktop.
Save wovalle/7b47c19df2d1e994d59158072a27be55 to your computer and use it in GitHub Desktop.
import { BaseFirestoreRepository, CustomRepository } from 'fireorm';
import Band from './models/Band';
@CustomRepository(Band)
class BandRepository extends BaseFirestoreRepository<Band> {
async getProgressiveRockBands(): Promise<Band[]> {
return this.whereArrayCointain('genres', 'progressive-rock').find();
}
}
const bandRepository = getRepository(Band);
const bands = await bandRepository.getProgressiveRockBands();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment