Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- db.wiezniowie.aggregate({
- $group : {
- _id: "$name",
- max: {
- $max : "$kara.dlugosc_wyroku"
- }
- }
- });
- db.wiezniowie.aggregate({
- $lookup : {
- from: "wiezienia",
- pipeline: [
- { $match : {rodzaj:"zakłady dla młodocianych"}}
- ],
- as: "newLookup"
- }
- $group : {
- _id: "$pesel",
- imie: "$imie",
- nazwisko: "$nazwisko",
- max_kara : {$max : "$kara.dlugosc_wyroku"}
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement