mongoose-type-dbref
A DBRef field-type for Mongoose schemas
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