04 - Create Many Records with model.create() - MongoDB and Mongoose - freeCodeCamp Tutorial

preview_player
Показать описание
We can bulk create many records in our database. Firstly, we set up an array with objects containing properties and values that correspond with our model's schema, and then call the create() method on the model with the array. This will generate documents from each object in the array and write them to the database.

Concepts:

Model
Models are fancy constructors compiled from Schema definitions. An instance of a model is called a document. Models are responsible for creating and reading documents from the underlying MongoDB database.

-————————————————————————————————————-
MongoDB is a cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with optional schemas. MongoDB is developed by MongoDB Inc. and licensed under the Server Side Public License (SSPL).

freeCodeCamp (also referred to as “Free Code Camp”) is a non-profit organization that consists of an interactive learning web platform, an online community forum, chat rooms, online publications and local organizations that intend to make learning web development accessible to anyone. Beginning with tutorials that introduce students to HTML, CSS and JavaScript, students progress to project assignments that they complete either alone or in pairs. Upon completion of all project tasks, students are partnered with other nonprofits to build web applications, giving the students practical development experience.

Thanks for Watching!
Рекомендации по теме
Комментарии
Автор

In this video you explain that we have to make an array variable, that .create() needs a second function etc. Why they dont clear out this in freecodecamp??? Should i be a magician to figure it out alone? Why should i understand it from YOUR video and they dont explain it enough??

ArisAris-fsip
Автор

The exercise has now been changed to "Modify the createManyPeople function to create many people using Model.create() with the argument arrayOfPeople." I did whatever you showed but for some reason it isn't working :(. Can you help me out?
Also, thanks a lot for these videos! They are very helpful! :)

samhero
join shbcf.ru