diff --git a/models/admins.js b/models/admins.js index f01eb8c..93ac8b2 100644 --- a/models/admins.js +++ b/models/admins.js @@ -1,4 +1,8 @@ var mongoose = require('mongoose'); +// patch to support MongoDB Server v3.5+ +mongoose.plugin(schema => { + schema.options.usePushEach = true; +}); var Schema = mongoose.Schema; var adminSchema = new mongoose.Schema({ diff --git a/models/logs.js b/models/logs.js index 47ec852..6b4eb19 100644 --- a/models/logs.js +++ b/models/logs.js @@ -1,4 +1,8 @@ var mongoose = require('mongoose'); +// patch to support MongoDB Server v3.5+ +mongoose.plugin(schema => { + schema.options.usePushEach = true; +}); var Schema = mongoose.Schema; var logSchema = new mongoose.Schema({ diff --git a/models/posts.js b/models/posts.js index 9d454ed..d3d0c05 100644 --- a/models/posts.js +++ b/models/posts.js @@ -1,4 +1,8 @@ var mongoose = require('mongoose'); +// patch to support MongoDB Server v3.5+ +mongoose.plugin(schema => { + schema.options.usePushEach = true; +}); var Schema = mongoose.Schema; var postSchema = new mongoose.Schema({ diff --git a/models/users.js b/models/users.js index 6e2d9bd..c1c29e2 100644 --- a/models/users.js +++ b/models/users.js @@ -1,4 +1,8 @@ var mongoose = require('mongoose'); +// patch to support MongoDB Server v3.5+ +mongoose.plugin(schema => { + schema.options.usePushEach = true; +}); var Schema = mongoose.Schema; var userSchema = new mongoose.Schema({