Posts by Juliane Magalhães • 71 points
2 posts
- 
		2 votes1 answer28 viewsA: I cannot return another field other than the primary key using $projectPeople got it, just project the attribute I wanted to show. db.animais.aggregate([ {$unwind : "$doencas" }, {$project : { year : {$year : "$doencas.data_diagnostico"}, apelido: 1 }}, {$match : {year… 
- 
		5 votes1 answer28 viewsQ: I cannot return another field other than the primary key using $projectI’m starting in Mongodb and would like to perform a consultation in my database of type: Which animals got sick in the year 2016? Using $group and $project: db.animais.aggregate([ {$unwind :…