mongoose-type-dbref

1.2.1 • Public • Published

mongoose-type-dbref

A DBRef field-type for Mongoose schemas

npm

usage

This will validate DBRefs, correctly:

var mongoose = require('mongoose');
require('mongoose-type-dbref');

var UserSchema = new mongoose.Schema({
    ref: {type: mongoose.SchemaTypes.DBRef, required: true, namespace: "MyNamespace"}
});

That is all...

Anything else you want to do, do it yourself :)

Note: Arrays are not supported

Testing

npm test

Package Sidebar

Install

npm i mongoose-type-dbref

Weekly Downloads

0

Version

1.2.1

License

MIT

Last publish

Collaborators

  • leofidjeland