Closed jozefcipa closed 3 years ago
Thanks for opening this PR, it has some good ideas. Proxy is an interesting solution. It requires some cleverness to recursively handle the chained paths below, but still seems safer than modifying the underlying prototypes.
await firestore.doc('collection/doc').delete();
await firestore.doc('collection/doc').collection('collection').doc('doc').delete();
await firestore.collection('collection').doc('doc').collection('collection').doc('doc').delete();
// etc
I'm closing this for now, but thanks again!
This PR brings a lot of changes, also some breaking ones.
Disclaimer: I suppose you won't merge this as it changes a lot of stuff but maybe some things might be useful and integrated as small PRs 🤔
FIXME
I believeFirebase
initialization, as originally it created a newapp
but never really used it (as it was usingnew Firestore
directly from@google-cloud/firestore
which is initialized via an environment variable). Now it doesn't initialize anything on its own. It rather accepts a firebase app instance or usesadmin.initializeApp()
with reading credentials fromGOOGLE_APPLICATION_CREDENTIALS
(when used via CLI)