Is your feature request related to a problem? Please describe.
We want to copy firebase user accounts over to MongoDB as a prerequisite to creating a referral system. At the moment we have no way of assigning unique referral codes to existing users as well as tracking who referred who.
Describe the solution you'd like
Create a User Schema with the following structure
type User = {
firebaseId: string; // self explanatory
referralCode: string; // generated in the script below
}
Create a temp js script that pings Firebase for a list of existing users, loops through them and creates a new User Document. Or batch create User Documents by calling User.insertMany with an array ofUser Documents
As part of the migration process a unique referral code is generated for each User using nanoid.
Is your feature request related to a problem? Please describe. We want to copy firebase user accounts over to MongoDB as a prerequisite to creating a referral system. At the moment we have no way of assigning unique referral codes to existing users as well as tracking who referred who.
Describe the solution you'd like Create a
User
Schema with the following structureCreate a temp
js
script that pings Firebase for a list of existing users, loops through them and creates a newUser
Document. Or batch createUser
Documents by callingUser.insertMany
with an array ofUser
DocumentsAs part of the migration process a unique referral code is generated for each User using nanoid.
Additional context