Mongoose id Plugin
Simple plugin for Mongoose which replaces document attribute _id with id.
Installation
npm install mongoose-id
Usage
var mongoose = ;var idPlugin = ;var UserSchema = username: String;UserSchema;mongoose;
By default, it will transform the document for both toJSON and toObject methods. You can disable any one by setting its option to false:
mongoose;
Don't transform document for toJSON() of all schemas.
Setting options.remove to true will remove the id attribute:
UserSchema;
License
The MIT License