📜  在 Firestore 中创建用户 uid - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:57.907000             🧑  作者: Mango

代码示例1
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp(functions.config().firebase);

const db = admin.firestore();

exports.createUser = functions.auth.user().onCreate((user) => {
    const { uid } = user;

    const userCollection = db.collection('users');

    userCollection.doc(uid).set({
        someData: "123"
    });
});