sdelements / lets-chat

Self-hosted chat app for small teams
http://sdelements.github.io/lets-chat
MIT License
9.76k stars 1.58k forks source link

MongoDB version 3.6.3 $pushAll Error #778

Open john-trieu-nguyen opened 6 years ago

john-trieu-nguyen commented 6 years ago

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 });

losingle commented 6 years ago

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

https://github.com/Automattic/mongoose/issues/5574#issuecomment-332290518