How to use the firebase-admin.firestore.FieldValue function in firebase-admin

To help you get started, we’ve selected a few firebase-admin 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 ninjinkun / blog-feedback-app / functions / src / repositories / mail-lock-repository.ts View on Github external
export function createMailLock(uuid: string, taskUUID: string): Promise {
    return db.collection('daily-mail-lock').doc(uuid).create({
        taskUUID,
        timestamp: firestore.FieldValue.serverTimestamp(),
    });
}
github yarnaimo / vanilla-clipper / functions / src / core / savePage.ts View on Github external
export const toDocData = (
    results: PR['save']>[],
    compact = false,
) => {
    const firstResult = results[0]
    const { hostname, domain } = tldjs.parse(firstResult.url)

    const docBase = {
        createdAt: firestore.FieldValue.serverTimestamp(),
        publishedAt: firstResult.mercury.date_published
            ? dayjs(firstResult.mercury.date_published)
            : null,

        url: firstResult.url,
        hostname,
        domain,

        texts: results.map(r => r.mercury.content),
        author: firstResult.mercury.author,
        leadImageDownloadUrl: firstResult.mercury.lead_image_url,

        title: firstResult.mercury.title,
        excerpts: results.map(r => r.mercury.excerpt),
    }