Mongoose

noun

say it: “MON-goos” /ˈmɑnˌɡus/

A popular Node.js library for MongoDB that adds schemas, checks and models on top of the official driver.

What is Mongoose?

Mongoose is the popular Node.js library for MongoDB. It adds schemas, validation and models on top of the driver.

const Recipe = mongoose.model('Recipe', new mongoose.Schema({ title: { type: String, required: true }, minutes: Number }));
await Recipe.create({ title: 'Pancakes', minutes: 20 });

In a sentence

  • “With Mongoose, Workout.find() replaces collection("workouts").find().”
  • “The workout API uses Mongoose to check each workout before it's saved.”

Level: Journeyman · More MongoDB terms at this level

Updated