Skip to content

Commit

Permalink
fix(mongodb): operation when partial update (#939)
Browse files Browse the repository at this point in the history
Co-authored-by: CZ <[email protected]>
  • Loading branch information
zccz14 and CZ authored Dec 7, 2024
1 parent 171986a commit 5fbd93e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
4 changes: 2 additions & 2 deletions apps/mongodb-storage/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ terminal.provideService('UpdateDataRecords', {}, (msg) => {
mergeMap((records) =>
from(records).pipe(
map((record) => ({
updateOne: {
replaceOne: {
filter: { id: record.id },
update: { $set: record as any },
replacement: record as any,
upsert: true,
},
})),
Expand Down
4 changes: 2 additions & 2 deletions apps/namespaced-mongodb-storage/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ from(adminHostTerminal.requestService('ListHost', {}))
mergeMap((records) =>
from(records).pipe(
map((record) => ({
updateOne: {
replaceOne: {
filter: { id: record.id, public_key: record.public_key },
update: { $set: record as any },
replacement: record as any,
upsert: true,
},
})),
Expand Down
10 changes: 10 additions & 0 deletions common/changes/@yuants/app-mongodb-storage/2024-12-07-14-15.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@yuants/app-mongodb-storage",
"comment": "fix operation when partial update",
"type": "patch"
}
],
"packageName": "@yuants/app-mongodb-storage"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@yuants/app-namespaced-mongodb-storage",
"comment": "fix operation when partial update",
"type": "patch"
}
],
"packageName": "@yuants/app-namespaced-mongodb-storage"
}

0 comments on commit 5fbd93e

Please sign in to comment.