01 - Install and Set Up Mongoose - MongoDB and Mongoose - freeCodeCamp Tutorial
Ganesh H
Before we can start accessing our database, we have to install MongoDB and Mongoose on our project. We can do this through NPM, and we can require Mongoose to use the connect() method to make a connection to our database.
Link to challenge : https://www.freecodecamp.org/learn/apis-and-microservices/mongodb-and-mongoose/install-and-set-up-mongoose Written Guide : https://www.notion.so/ganeshh123/Install-and-Set-Up-Mongoose-de92a67d73c9491abae35a675b7de2b4
Full Playlist for this course : https://www.youtube.com/playlist?list=PLhGp6N0DI_1QJMb63oecYZ3lLjrF4PnIs All Writen Guides for this course : https://www.notion.so/ganeshh123/6f987e7260914612b06adf840dbb00c3 All My Tutorials can be found at : https://www.notion.so/Tutorials-Ganesh-H-293ea420d34a464f9a1907e0405b5f26
Concepts: mongoose.connect() Opens the default mongoose connection. https://mongoosejs.com/docs/api/mongoose.html#mongoose_Mongoose-connect
require() Used to import modules, JSON, and local files. Modules can be imported from node_modules. https://nodejs.org/api/modules.html#modules_require_id
dependencies Dependencies are specified in a simple object that maps a package name to a version range. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or git URL. https://docs.npmjs.com/files/package.json#dependencies
package.json All npm packages contain a file, usually in the project root, called package.json - this file holds various metadata relevant to the project. This file is used to give information to npm that allows it to identify the project as well as handle the project's dependencies. It can also contain other metadata such as a project description, the version of the project in a particular distribution, license information, even configuration data - all of which can be vital to both npm and to the end users of the package. The package.json file is normally located at the root directory of a Node.js project. https://nodejs.org/en/knowledge/getting-started/npm/what-is-the-file-package-json/ -————————————————————————————————————- 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).
Mongoose is an Object Data Modeling (ODM) library for MongoDB and Node.js. It manages relationships between data, provides schema validation, and is used to translate between objects in code and the representation of those objects in MongoDB.
freeCodeCamp (also referred to as “Free Code Camp”) is a non-profit organization that consists of an inter ... https://www.youtube.com/watch?v=nBZYUjyO9hY
20797394 Bytes