How to use the @firebase/app.firebase.firestore function in @firebase/app

To help you get started, we’ve selected a few @firebase/app examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github deckgo / deckdeckgo / studio / src / app / services / data / feed / feed.service.tsx View on Github external
private query(): Promise {
        const firestore: firebase.firestore.Firestore = firebase.firestore();

        if (this.nextQueryAfter) {
            return firestore.collection('decks')
                    .where('meta.feed', '==', true)
                    .orderBy('meta.published_at', 'desc')
                    .startAfter(this.nextQueryAfter)
                    .limit(this.queryLimit).get();
        } else {
            return firestore.collection('decks')
                    .where('meta.feed', '==', true)
                    .orderBy('meta.published_at', 'desc')
                    .limit(this.queryLimit).get();
        }
    }
github MobileTribe / panda-lab / agent / src / services / repositories / firebase.repository.ts View on Github external
getCollection(name: CollectionName): CollectionReference {
        return firebase.firestore().collection(name)
    }
github deckgo / deckdeckgo / studio / src / app / services / data / user / user.service.tsx View on Github external
return new Promise(async (resolve, reject) => {
            const firestore: firebase.firestore.Firestore = firebase.firestore();

            const now: firebase.firestore.Timestamp = firebase.firestore.Timestamp.now();
            user.data.updated_at = now;

            try {
                await firestore.collection('users').doc(user.id).set(user.data, {merge: true});

                resolve(user);
            } catch (err) {
                reject(err);
            }
        });
    }
github deckgo / deckdeckgo / studio / src / app / services / data / deck / deck.service.tsx View on Github external
return new Promise(async (resolve, reject) => {
            const firestore: firebase.firestore.Firestore = firebase.firestore();

            try {
                const snapshot: firebase.firestore.DocumentSnapshot = await firestore.collection('decks').doc(deckId).get();

                if (!snapshot.exists) {
                    reject('Deck not found');
                    return;
                }

                const deck: DeckData = snapshot.data() as DeckData;

                resolve({
                    id: snapshot.id,
                    data: deck
                });
            } catch (err) {
github deckgo / deckdeckgo / studio / src / app / services / data / slide / slide.service.tsx View on Github external
return new Promise(async (resolve, reject) => {
            const firestore: firebase.firestore.Firestore = firebase.firestore();

            try {
                const snapshot: firebase.firestore.DocumentSnapshot = await firestore.collection(`/decks/${deckId}/slides`).doc(slideId).get();

                if (!snapshot.exists) {
                    reject('Slide not found');
                    return;
                }

                const slide: SlideData = snapshot.data() as SlideData;

                resolve({
                    id: snapshot.id,
                    data: slide
                });
            } catch (err) {