const mongoose = require('mongoose').set('debug', false)
const Schema = mongoose.Schema;

mongoose.Promise = global.Promise;
mongoose.level = "F";

const { ObjectID } = require('mongodb');

// Resolving error Unknown modifier: $pushAll
mongoose.plugin(schema => {
  schema.options.usePushEach = true
});


const SubscriberSchema = new Schema({
  endpoint: String,
  keys: Schema.Types.Mixed,
  userId: String,
  access: String,
  browser: String,
  createDate: {
    type: Date,
    default: Date.now
  }
});

mongoose.model('subscribers', SubscriberSchema);
