- PUSH Notification
This commit is contained in:
@@ -1,16 +1,22 @@
|
||||
var bcrypt = require('bcrypt');
|
||||
|
||||
const mongoose = require('mongoose');
|
||||
const validator = require('validator');
|
||||
const jwt = require('jsonwebtoken');
|
||||
const _ = require('lodash');
|
||||
|
||||
|
||||
mongoose.Promise = global.Promise;
|
||||
|
||||
mongoose.level = "F";
|
||||
// Resolving error Unknown modifier: $pushAll
|
||||
mongoose.plugin(schema => { schema.options.usePushEach = true });
|
||||
|
||||
mongoose.set('debug', process.env.DEBUG);
|
||||
|
||||
var UserSchema = new mongoose.Schema({
|
||||
userId: {
|
||||
type: String,
|
||||
},
|
||||
email: {
|
||||
type: String,
|
||||
required: true,
|
||||
@@ -72,7 +78,7 @@ UserSchema.methods.toJSON = function () {
|
||||
var user = this;
|
||||
var userObject = user.toObject();
|
||||
|
||||
return _.pick(userObject, ['_id', 'email', 'verified_email', 'username']);
|
||||
return _.pick(userObject, ['_id', 'email', 'verified_email', 'username', 'userId']);
|
||||
};
|
||||
|
||||
UserSchema.methods.generateAuthToken = function () {
|
||||
|
||||
Reference in New Issue
Block a user