def get_users_timeline_from_db(): uslov = { 'timeline': { '$not': { '$size': 0 } } } return DataOperations.load_from_mongo('users_crawl', 'users_timelines', True, criteria=uslov)
def __iter__(self): for cursor in DataOperations.load_from_mongo('users_crawl', 'users_vectors', True): # assume there's one document per line, tokens separated by whitespace yield cursor['vector']
def get_users_friends_from_db(): friends_ids = DataOperations.load_from_mongo('users_crawl', 'users_ids') return friends_ids