Skip to content

Commit

Permalink
Add push each flag to Mongoose for compatibility with MongoDB 3.6.
Browse files Browse the repository at this point in the history
  • Loading branch information
muety committed Aug 17, 2019
1 parent 246f481 commit 48769a4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/models/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ var CollectionSchema = new Schema({
},
toJSON: {
virtuals: true
}
},
usePushEach: true
});

mongoose.model('Collection', CollectionSchema);
Expand Down
3 changes: 2 additions & 1 deletion app/models/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ var ImageSchema = new Schema({
},
toJSON: {
virtuals: true
}
},
usePushEach: true
});

ImageSchema.virtual('href').get(function () {
Expand Down
3 changes: 2 additions & 1 deletion app/models/shortlink.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ var ShortlinkSchema = new Schema({
},
toJSON: {
virtuals: true
}
},
usePushEach: true
});

ShortlinkSchema.virtual('href').get(function () {
Expand Down
2 changes: 2 additions & 0 deletions app/models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ var userSchema = mongoose.Schema({
email : String,
name : String
}
}, {
usePushEach: true
});

userSchema.methods.generateHash = function(password) {
Expand Down

0 comments on commit 48769a4

Please sign in to comment.