Okay so basically I have my events schema:
var eventSchema = mongoose.Schema({
name:{
type: String,
},
etc...
and I have my venue schema:
var venueSchema = mongoose.Schema(
{
name:{
type: String,
},
now I want the events to also contain a venue
How do I code this such that when I call the events it returns the events, with the event data, along with its venue and the venue data, i.e.
{
"events":[
{
"event_id":"e_1",
"name":"nameOfEvent",
"venue":{
"name":"nameOfVenue"
etc...
Thanks in advance!!
Aucun commentaire:
Enregistrer un commentaire