|
|
|
@ -30,7 +30,7 @@ sols = ['db.bills.find({sponsor_name:"Marco Rubio"}, {_id:0, title: 1, sponsor_n
|
|
|
|
|
foreignField: "sponsor_state",
|
|
|
|
|
as:"otherBills"} },
|
|
|
|
|
{ $unwind: "$otherBills" },
|
|
|
|
|
{ $project: {title: 1, sponsor_name: 1, sponsor_state: 1, otherbill_id: "$otherBills._id", otherbill_title: "$otherBills.title", otherbill_sponser_name: "$otherBills.sponsor_name", otherbill_sponsor_state: "$otherBills.sponsor_state"}},
|
|
|
|
|
{ $project: {title: 1, sponsor_name: 1, sponsor_state: 1, otherbill_id: "$otherBills._id", otherbill_title: "$otherBills.title", otherbill_sponsor_name: "$otherBills.sponsor_name", otherbill_sponsor_state: "$otherBills.sponsor_state"}},
|
|
|
|
|
{ $match: {$expr: {$lt: ["$_id", "$otherbill_id"]}}}
|
|
|
|
|
])''',
|
|
|
|
|
'''db.congress.aggregate([
|
|
|
|
|