sdelements/lets-chat

MongoDB version 3.6.3 $pushAll Error

john-trieu-nguyen opened this issue · 1 comments

When joining a password protected private room with MongoDB version 3.6.3, error is thrown:
MongoError: Unknown modifier: $pushAll

$pushAll has been deprecated since 2.4 and it is no longer in MongoDB 3.6.3.

To fix, add { usePushEach: true } to the var RoomSchema in app/models/room.js

Previously:
var RoomSchema = new mongoose.Schema({
...
});

New:
var RoomSchema = new mongoose.Schema({
...
}, { usePushEach: true });

I had the same problem, and that was the solution.

Automattic/mongoose#5574 (comment)