Skip to content

Documentation #10

Description

@nonoumasy

I tried following the documentation to rename one fo the fields( "year" to "startYear") in my Firestore collection. However, I just couldn't follow with the documentation provided.

To summarize what I did:

  1. initialized a node app using npm init -y
  2. npm install firebase-admin
  3. generated new private key and added this to project folder
  4. npm installed the fireboost package
  5. created a file called firebaseTool.js and added the code below"
import { FireBoost } from 'fireboost';
import * as admin from 'firebase-admin';

const fireBoost = new FireBoost();

const serviceAccount = require('./downloadedAccount.json')

const app = await admin.initializeApp({
    credential: admin.credential.cert(serviceAccount),
    databaseURL: "my_db_url"});

const appAuthRef = new FireBoost().auth(app);

const colRef = app.firestore.collection('stories');
const utilColRef = fireBoostFirestore.ref(colRef);

utilColRef.renameFieldDocs({ year: 'startYear' })

the error I'm getting is
SyntaxError: Cannot use import statement outside a module

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