i am a newbie in firebase firestore. i am trying to write this the following data below to my firestore database:
export const testingOnly = functions.database.ref('users/{userID}/')
.onCreate((snapshot, context) => {
let addDoc = {
c_username: 'Amanda',
c_password: 'adamma21',
isEmailConfirmed: true,
isTelephoneNumberConfirmed: false
}
return snapshot.ref.set(addDoc);
});
Following a tut, i ran the following on the terminal:
npm run-script build
firebase functions: shell
It showed me this:
C:\brighterbrains\functions> npm run-script build
> functions@ build C:\brighterbrains\functions
> tsc
PS C:\brighterbrains\functions> firebase functions:shell
! Your requested "node" version "8" doesn't match your global version "12"
+ functions: Emulator started at http://localhost:5000
i functions: Loaded functions: testingOnly
firebase > testingOnly
[Function: bound ]
firebase >
i checked my Firestore db, it is still empty.
Am i doing this right? is there anything i am missing from my code?
i need help.