master
bill 6 months ago
parent a31f90ed1e
commit 8901a7d2e2

@ -25,10 +25,13 @@ def comparator(a, b):
return cmp
else: return 1
return 0
from bson import ObjectId
match (a, b):
case (dict(), dict()):
return itcmp([*a.keys(), *a.values()], [*b.keys(), *b.values()])
case (ObjectId(aa), ObjectId(bb)):
return cmp(aa, bb)
case (Iterable(), Iterable()):
return itcmp(a, b)
case _ if type(a) == type(b):

@ -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([

@ -7,4 +7,4 @@ sed -i '1s/^/server.default_listen_address=0.0.0.0\n/' /etc/neo4j/neo4j.conf
systemctl enable --now neo4j
neo4j-admin dbms set-initial-password 4Sfz541Lm --require-password-change=false
python3 -m pip install neo4j
python3 -m pip install neo4j

Loading…
Cancel
Save