Once connected, the open event is fired on the Connection instance. If
you're using mongoose.connect, the Connection is mongoose.connection.
Otherwise, mongoose.createConnection return value is a Connection.

Important! Mongoose buffers all the commands until it's connected to the
database. This means that you don't have to wait until it connects to MongoDB
in order to define models, run queries, etc.

API docs

Getting support

Driver access

The driver being used defaults to node-mongodb-native and is directly accessible through YourModel.collection. Note: using the driver directly bypasses all Mongoose power-tools like validation, getters, setters, hooks, etc.

Mongoose Plugins

The following plugins are currently available for use with mongoose:

mongoose-types - Adds
several additional types (e.g., Email) that you can use in your
Schema declarations

Contributing to Mongoose

Cloning the repository

Make a fork of mongoose, then clone it in your computer. The v2.x branch
contains the current stable release, and the master branch the next upcoming
major release.

Guidelines

Please write inline documentation for new methods or class members.

Please write tests and make sure your tests pass.

Before starting to write code, look for existing tickets or create one for
your specific issue (unless you're addressing something that's clearly broken).
That way you avoid working on something that might not be of interest or that
has been addressed already in a different branch.

Credits

License

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.