N
N
novicheck2016-07-21 14:37:00
Python
novicheck, 2016-07-21 14:37:00

How to check the uniqueness of a user?

I have to plot the playing players by base in Mongo. I get information from the database like this:

heh = list(db.events.aggregate(
            [
                    		{ "$match": {"status": 'start'}},
    				{"$group": {"_id": "$eventName", "players": {"$sum": 1}}},
    				]))

but this code counts the total start of the level, and I need to get the number of unique users who started the level. Tell me how to check for repetition of the level? I get all unique users like this:
db.events.distinct("uid", {"is_buyer": 1})

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question