Watch keynotes and sessions from MongoDB.live, our virtual developer conference.

MongoDB "InsertOne" inserts multiple documents

Hello, I am using the node.js library and “insertOne” function to insert a document: https://github.com/JimLynchCodes/Super-Scraper/blob/master/backend/server.js#L118

For some reason, this creates TWO of this document in the database (3 seconds apart).

I am totally baffled here. Can anyone explain why this creates two documents and not one? :thinking:

BTW - it would be nice if you guys didn’t kill the slack channel. :disappointed:

turns out I was actually just calling the insertOne function twice.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.