Self Hosted Server not saving transactions in MONGO properly

I followed https://v1docs.moralis.io/moralis-dapp/getting-started/self-hosting-moralis-server this tutorial and this https://www.youtube.com/watch?v=o8MAFOFc7H0&t=426s 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