const mongoose = require('mongoose'); 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 cfgserverSchema = new Schema({ chiave: { type: String, required: true, trim: true, minlength: 1, }, idapp: { type: String, }, userId: { type: String, }, valore: { type: String, }, }); mongoose.model('cfgserver', cfgserverSchema);