fireboost
fireboost copied to clipboard
Firestore Collection renameFieldDocs returns Something Went Wrong error
Code:
const { FireBoost } = require('fireboost');
const firestore = admin.firestore();
const admin = require('firebase-admin');
const certs = require('../certs.json');
admin.initializeApp({
credential: admin.credential.cert(certs),
databaseURL: 'https://blah.firebaseio.com',
});
function renameData() {
const fireBoost = new FireBoost().firestore();
const colRef = firestore.collection('Ventures');
const utilColRef = fireBoost.ref(colRef);
utilColRef.renameFieldDocs({ cover_image_url: 'coverImageUrl' });
}
renameData();
I'm trying to rename an attribute in all the documents in one of my collections. For some reason it keeps giving me a Something Went Wrong
error. After checking the source code in this repo it seems like the error is because of this code here https://github.com/39ro/fireboost/blob/master/src/firestore.ts#L153. I double checked the type of colRef
and verified that it is returning a CollectionReference
. So I'm not sure why this is happening.
Any help here would be appreciated.
I also see this error when I try to rename a field in the docs of a collection. I use mostly the same code as above. Also fails for attempting to rename a field in a single document.