Skip to content

Firestore Collection renameFieldDocs returns Something Went Wrong error #12

Description

@isab

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions