Self Hosted Server not saving transactions in MONGO properly

I followed this tutorial and this video to listen to blockchain transactions and store them in my mongodb database, It is doing all that but there is a problem, whenever it stores a new record in the db, instead of creating a new document in the db sometimes it seems to overwrite a previously made document

when it writes a document in the database, it could be a specific key that it looks for (it could be a combination of column values), if another record already exists with that key then it may overwrite it (I don’t know if this is really the case here)

1 Like

Yeah I suspect that too but since the code in the tutorial i followed is writing the documents to the db automatically, im not really sure what’s happening behind scenes