Skip to content

Create an external id to use in stead of the usual Mongo ObjectId

License

Notifications You must be signed in to change notification settings

Sandyman/mongo-external-id

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mongo-external-id

This plugin for mongoose creates a new field called xid in the Schema. This xid is an obfuscated version of the internal _id, which is a Mongoose ObjectId.

Installation

npm install mongo-external-id --save

Usage

var obfuscate = require('monguscate').obfuscate;      // for example
var mongoExternalId = require('mongo-external-id');
var SomeSchema = new Schema({...});
SomeSchema.methods.obfuscate = obfuscate;
SomeSchema.plugin(mongoExternalId);

Tests

npm test

Release History

  • 0.1.0 Initial release

About

Create an external id to use in stead of the usual Mongo ObjectId

Resources

License

Stars

Watchers

Forks

Packages

No packages published