Home  >  Q&A  >  body text

java - mongodb 数据统计(留存率) 应该怎么实现?

巴扎黑巴扎黑2764 days ago501

reply all(2)I'll reply

  • 黄舟

    黄舟2017-04-17 13:15:09

    http://docs.mongodb.org/manual/aggregation/

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-17 13:15:09

    Design like this:

    {
        player: {
            id: 123,
            name: 'zhangsan',
            register_time: 
        },
        login_time: 
    }
    

    Then aggregate
    First filter by register_time, then group by login_time

    I guess you still don’t know how to...

    Also, I think, don’t do this, it requires a lot of calculations

    reply
    0
  • Cancelreply