O'Reilly logo

Mongoose for Application Development by Simon Holmes

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 11. Plugins – Re-using Code

In this chapter, we will introduce the Mongoose plugin architecture and see how we can use it to create modular re-usable code. We will look at the syntax and how to write them and include them in our code.

By the end of this chapter, you will understand how to create and use Mongoose plugins. You will also know where to go to find existing plugins that others have written, and contribute to the community by submitting your own. You will have created some plugins in the MongoosePM application.

Reusable schema plugins

If we look at our schemas, we can see some common elements that we are repeating. For example, each of our schemas has an identical modifiedOn path, and our project and task schemas each have identical ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required