mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02:00
Updated MongoDB 5 rawCollection deprecated update to updateMany (or updateOne).
Thanks to xet7 !
This commit is contained in:
parent
3fb709ed70
commit
a196a5ed63
1 changed files with 3 additions and 3 deletions
|
@ -717,7 +717,7 @@ Migrations.add('add-missing-created-and-modified', () => {
|
|||
modifiedAtTables.map(db =>
|
||||
db
|
||||
.rawCollection()
|
||||
.update(
|
||||
.updateMany(
|
||||
{ modifiedAt: { $exists: false } },
|
||||
{ $set: { modifiedAt: new Date() } },
|
||||
{ multi: true },
|
||||
|
@ -725,7 +725,7 @@ Migrations.add('add-missing-created-and-modified', () => {
|
|||
.then(() =>
|
||||
db
|
||||
.rawCollection()
|
||||
.update(
|
||||
.updateMany(
|
||||
{ createdAt: { $exists: false } },
|
||||
{ $set: { createdAt: new Date() } },
|
||||
{ multi: true },
|
||||
|
@ -772,7 +772,7 @@ Migrations.add('fix-incorrect-dates', () => {
|
|||
.rawCollection()
|
||||
.find({ $or: [{ createdAt: { $type: 1 } }, { updatedAt: { $type: 1 } }] })
|
||||
.forEach(({ _id, createdAt, updatedAt }) => {
|
||||
t.rawCollection().update(
|
||||
t.rawCollection().updateMany(
|
||||
{ _id },
|
||||
{
|
||||
$set: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue