Field note
What it does
Getting Started First be sure you have MongoDB and Node.js installed. Next install Mongoose from the command line using npm : npm install mongoose Now say we like fuzzy kittens and want to record every kitten we ever meet in MongoDB. The first thing we need to do is include mongoose in our project and open a connection to the test database on our locally running instance of MongoDB. // getting-started.js const mongoose = require ( 'mongoose' ); main (). catch ( err => console . log (err)); async function main ( ) { await mongoose. connect ( 'mongodb://127.0.0.1:27017/test' ); // use `await mongoose.connect('mongodb://user:password@127.0.0.1:27017/test');` if your database has auth enabled } For brevity, let's assume that all following code is within the main() function. With Mongoose, everything is derived from a Schema .
Capabilities
Available capabilities
Tags
Tags
No tags filed yet.
Ways to use it
Ways to use it
javascript / mongoose