mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-22 19:43:16 +00:00
🐛 fix findOneAndUpdate
This commit is contained in:
1 parent
5e12d799e3
commit
4105df8dcb
17 files changed
+39
-38
No files matched your search
@@ -12,8 +12,12 @@ const connection = mongoose.createConnection(uri, {
|
||||
autoIndex: true,
|
||||
useNewUrlParser: true,
|
||||
useUnifiedTopology: true,
|
||||
useFindAndModify: false,
|
||||
useFindAndModify: true,
|
||||
});
|
||||
|
||||
// this will return the new updated document for findOneAndUpdate
|
||||
mongoose.set("returnOriginal", false); // https://mongoosejs.com/docs/api/model.html#model_Model.findOneAndUpdate
|
||||
|
||||
console.log(`[Database] connect: mongodb://${url.username}@${url.host}${url.pathname}${url.search}`);
|
||||
connection.once("open", () => {
|
||||
console.log("[Database] connected");
|
||||
|
||||
Reference in new issue
Block a user