What is the recommended way to share Firestore api logic (between the admin node.js and the js web) when upgrading to the web v9 modular sdk? The way I did it before was just supplying the db (and deleteField) if it was used by a serverless function.
// admin db init
import { FieldValue, getFirestore } from "firebase-admin/firestore"
const FSAdmin = createFirebaseAdminApp(options);
const db = getFirestore(FSAdmin)
That no longer seems to work as if you try to use the getFirestore(FSAdmin)
with the v9 docRef doc(db, collectionName, documentID)
it will give you an error:
FirebaseError: Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore