I am trying reference another object in a model in node,
User = new Schema({
username: {
type: String,
index: {unique: true}
I decided to solve a similar problem for my project by making my subdocument a nested type
Foo = new Schema({
name: String,
bar: {
name: String
}
});
Obviously this will not work if you need Bar to be its own model. Perhaps because you reference it as a model in other objects. In my case this was all I needed to do, but the Subdocuments section of the Mongoose guide does not mention it as an option so I am adding to this discussion.