简体   繁体   中英

how to push my object of array into MongoDB

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.

enter image description here

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM