graffiti-mongoose icon indicating copy to clipboard operation
graffiti-mongoose copied to clipboard

Inverse references

Open rushidesai opened this issue 8 years ago • 2 comments

If I have two schemas like this:

var personSchema = Schema({
  name    : String,
  age     : Number,
});

var storySchema = Schema({
  _creator : { type: Schema.Types.ObjectId, ref: 'Person' },
  title    : String,
  fans     : [{ type: Schema.Types.ObjectId, ref: 'Person' }]
});

It would be nice to be able to add a connection from person to stories that results in Story.find({_creator:...})

rushidesai avatar Oct 28 '15 08:10 rushidesai

related to #64

sibelius avatar Jan 23 '16 15:01 sibelius

+1!

jontonsoup avatar Feb 07 '16 23:02 jontonsoup