Skip to content

Instantly share code, notes, and snippets.

@lakshmankashyap
Created January 22, 2018 16:37
Show Gist options
  • Save lakshmankashyap/d05b1a1844a2998dde4814d42e131b96 to your computer and use it in GitHub Desktop.
Save lakshmankashyap/d05b1a1844a2998dde4814d42e131b96 to your computer and use it in GitHub Desktop.
Mongo push error
const userSchema = new mongoose.Schema({
email: {
type: String,
unique: true,
trim: true,
required: true
},
name: {
type: String,
trim: true,
required: true
},
status: {
activeEmailToken: { type: String },
activeEmailTokenExp: {type: Date },
resetPassToken: { type: String ,default: null},
resetPassExp: { type: Date ,default: null},
activTempEmail: { type: String ,default: null},
otp :{ type: String ,default: null},
active:{type: Boolean,default:false},
type: {type:Number,default:2} // 0 superuser,1 users
},
avatar: { type: String , default: null},
referral: { type: String , default: null,trim: true,},
refGenId: { type: String ,trim: true,},
totalToken: { type: String , default: '0'},
referralBonus: [{type: mongoose.Schema.ObjectId, ref: 'referralBonus'}],
orders: [{type: mongoose.Schema.ObjectId, ref: 'order'}],
phone: {
countryCode:String,
country:String,
number:Number,
},
created:{type: Date, default: Date.now},
password: String,
},{ usePushEach: true });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment