https://firebase.google.com/docs/firestore/manage-data/add-data#update_elements_in_an_array
Specifically, I need to use firebase.firestore.FieldValue.arrayUnion("greater_virginia") to update an array.
Firebase (v8) functions is setup with:
const admin = require('firebase-admin')
admin.initializeApp()
const db = admin.firestore()
module.exports = { admin, db }
Using it as written in the docs returns "ReferenceError: firebase is not defined".
Using db.FieldValue... returns "TypeError: Cannot read property 'arrayUnion' of undefined".
I don't have a whole lot of flexibility for wholesale change of the config, but I can modify some things.
How should I set this up so that I can use that firestore method?