Skip to content

Commit b6070c9

Browse files
committed
chore: change deleteMany to drop
change deletemany to drop when overRide giftcards DB
1 parent 0589564 commit b6070c9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

service/src/storage/mongo.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ export async function updateAmountMinusOne(userId: string) {
7171
export async function updateGiftCards(data: GiftCard[], overRide = true) {
7272
if (overRide) {
7373
// i am not sure is there a drop option for the node driver reference https://mongodb.github.io/node-mongodb-native/6.4/
74-
await redeemCol.deleteMany({})
74+
// await redeemCol.deleteMany({})
75+
await redeemCol.drop()
7576
}
7677
const insertResult = await redeemCol.insertMany(data)
7778
return insertResult

0 commit comments

Comments
 (0)