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.
2 parents 1cf3ec1 + 791c5e5 commit c0ce6afCopy full SHA for c0ce6af
src/db/mongo/pushes.js
@@ -57,7 +57,10 @@ const writeAudit = async (action) => {
57
const options = { upsert: true };
58
const collection = await connect(cnName);
59
delete data._id;
60
- await collection.updateOne({ id: data.id }, { $set: data }, options);
+ if (typeof data.id !== 'string') {
61
+ throw new Error('Invalid id');
62
+ }
63
+ await collection.updateOne({ id: { $eq: data.id } }, { $set: data }, options);
64
return action;
65
};
66
0 commit comments