We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e0ecfe commit 89f691fCopy full SHA for 89f691f
packages/mongo/src/MongoDbCollection.ts
@@ -49,6 +49,10 @@ export class MongoDbCollection implements IDatabaseCollection {
49
data = data.toJSON();
50
}
51
52
+ if (!("id" in oldDoc)) {
53
+ throw new Error("Patching is not supported for documents with an 'id' field. Use 'update' instead.");
54
+ }
55
+
56
const patch = jsonpatch.compare(oldDoc, data);
57
const filter = { id: oldDoc.id };
58
0 commit comments