Last active
January 20, 2022 20:50
-
-
Save wovalle/7b47c19df2d1e994d59158072a27be55 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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