-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
This code doesn't look like it'll allow null values
if (schema[property.toString()].describe()['type'] === 'dbref') {
if (typeof value === 'string') {
return Reflect.set(target, '__id__' + property.toString(), value)
&& Reflect.set(target, '__obj__' + property.toString(), null);
}
else if (value instanceof Document) {
return Reflect.set(target, '__id__' + property.toString(), value.id)
&& Reflect.set(target, '__obj__' + property.toString(), value);
}
else {
throw new Error("Can only set a foreign reference with an id or Document subclass instance")
}
}
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working