Thursday 8 June 2017

Mongoose SchemaTypes Syntax: Array of ObjectIds

Is this

blog: [{type: Schema.Types.ObjectId, ref: 'BlogEntry'}]

the same as this

blog: {type: [Schema.Types.ObjectId], ref: 'BlogEntry'}

or is the second example incorrect?



via White Noise

No comments:

Post a Comment