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:
- initialized a node app using npm init -y
- npm install firebase-admin
- generated new private key and added this to project folder
- npm installed the fireboost package
- 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
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:
the error I'm getting is
SyntaxError: Cannot use import statement outside a module