Posts by Tobias Guimarães • 36 points
1 post
-
2
votes1
answer554
viewsA: How to create a field that references a sub-array of a Collection in Mongoose?
Good morning! You only need to reference the document attribute that will be referenced. idTurma: {type: Schema.Types.ObjectId, ref : 'Escolas.turmas'} Viewing your student schema, you can omit the…