__author__ = 'ronfe' import sys sys.path.append('..') from wheels import uf from wheels.metaConfig import * new_users = uf.get_new_user_id() print("2. 进入启动页面 UV enterGuidePage:") pipeLine = [{ "$match": { "eventKey": "enterGuidePage", "eventTime": { "$gte": START_DATE, "$lt": END_DATE }, "platform": "app", "platform2": "iOS" } }, { "$group": { "_id": None, "devices": { "$addToSet": "$device" } } }] device_list = list(events.aggregate(pipeLine))[0]['devices']
__author__ = 'ronfe' import sys sys.path.append('..') from wheels import uf from wheels.metaConfig import * new_users = uf.get_new_user_id() # TODO: videotype how to? print("15. 完成一个专题 problemSetSuccess:") pipeLine = [ {"$match": {"eventKey": "problemSetSuccess", "eventTime": {"$gte": START_DATE, "$lt": END_DATE}, "platform": "app", "platform2": "iOS"}}, {"$group": {"_id": None, "devices": {"$addToSet": "$device"}}} ] device_list = list(events.aggregate(pipeLine))[0]['devices'] pipeLine = [ {"$match": {"eventKey": "problemSetSuccess", "eventTime": {"$gte": START_DATE, "$lt": END_DATE}, "platform": "app", "platform2": "iOS"}}, {"$group": {"_id": None, "users": {"$addToSet": "$user"}}} ] user_list = list(events.aggregate(pipeLine))[0]['users'] result_device = set.intersection(set(new_users['devices']), set(device_list)) new_user_list = [] for k, v in new_users.iteritems(): new_user_list.extend(v)