1.2.1 • Published 9 years ago

mongoose-type-dbref v1.2.1

Weekly downloads
7
License
MIT
Repository
github
Last release
9 years ago

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