- PUSH Notification
This commit is contained in:
22
server/models/subscribers.js
Normal file
22
server/models/subscribers.js
Normal file
@@ -0,0 +1,22 @@
|
||||
const mongoose = require('mongoose');
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
mongoose.Promise = global.Promise;
|
||||
mongoose.level = "F";
|
||||
|
||||
// Resolving error Unknown modifier: $pushAll
|
||||
mongoose.plugin(schema => {
|
||||
schema.options.usePushEach = true
|
||||
});
|
||||
|
||||
|
||||
const SubscriberSchema = new Schema({
|
||||
endpoint: String,
|
||||
keys: Schema.Types.Mixed,
|
||||
createDate: {
|
||||
type: Date,
|
||||
default: Date.now
|
||||
}
|
||||
});
|
||||
|
||||
mongoose.model('subscribers', SubscriberSchema);
|
||||
Reference in New Issue
Block a user