I had a.txt file full of names, I got the data, I turned it into an object of array.
Now I need to push my array into MongoDB but I don't know how to do it.
You need to connect to the database and then use collection.insertOne()
or collection.insertMany()
to add the names to your collection.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.