from pymongo import MongoClient, ASCENDING, DESCENDING
con = MongoClient('localhost:27017')
for x in con.db.collection.find( {'field' : 'value'} ).sort([('student_id', ASCENDING)]):
print x
heh = list(db.events.aggregate(
[
{"$match": {"status": 'start'}},
{"$group": {"_id": "$eventName", "players": {"$addToSet": "$uid"}}},
{"$unwind": "$players"},
{"$group": {"_id": "$_id", "Count": {"$sum": 1}}},
]))
<script>
if (window.localStorage) {
var lastVisitTime = window.localStorage.getItem('last_visit_time');
if (lastVisitTime) {
alert('Вы обновили страницу, в последний раз страница была загружена: ' + lastVisitTime);
}
window.localStorage.setItem('last_visit_time', (new Date()).toString());
}
</script>