Answer the question
In order to leave comments, you need to log in
How can I check if an element is in a list?
I need to get a list of people matching person : start date but I need people only for a certain parameter. Parameter:
uidpay = list(db.events.distinct("uid", {"is_buyer": 1}))
and his example:[u'6210A609-03CD-4646-9B69-D6F0C455D5E7', u'14738D3A-E80E-4A51-97A9-787E646AEF18']
. This is how I get the start time:lel = list(db.events.aggregate(
[
{"$match": {"eventName" : "Level 1"}},
{"$group": {"_id": "$uid", "dateofstart": {"$addToSet": "$updated_at"}}}
]))
meh = [{"u'F829CB26-CF2B-4896-92D6-17B1519948C7'": u'F829CB26-CF2B-4896-92D6-17B1519948C7'}, {"u'6071a6fb-4d93-4589-84a7-8a8c8ce37094'": u'6071a6fb-4d93-4589-84a7-8a8c8ce37094'}]
for players in meh:
kost = str(players.keys())
print(kost)
kost = kost[2:41]
print(kost)
if kost == uidpay:
dateoflvl1pay.append(players)
print(dateoflvl1pay)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question