diff --git a/services/chat/app/js/Features/Threads/ThreadManager.js b/services/chat/app/js/Features/Threads/ThreadManager.js index 4a62f4836d..f1cf24bcfa 100644 --- a/services/chat/app/js/Features/Threads/ThreadManager.js +++ b/services/chat/app/js/Features/Threads/ThreadManager.js @@ -47,15 +47,15 @@ module.exports = ThreadManager = { } } - db.rooms.updateOne( + db.rooms.findOneAndUpdate( query, { $set: update }, - { upsert: true }, - function (error) { + { upsert: true, returnDocument: 'after' }, + function (error, result) { if (error != null) { return callback(error) } - db.rooms.findOne(query, callback) + callback(null, result.value) } ) },