MongoDB : Is there a way to detect a value trend using aggregation?
问题 I'm trying to detect the "trend" of a value in a collection. Let's say I have the following: { created_at: 2014-12-01, value:1015 } { created_at: 2014-12-01, value:1015 } { created_at: 2014-12-01, value:1019 } { created_at: 2014-12-02, value:1018 } { created_at: 2014-12-02, value:1021 } { created_at: 2014-12-03, value:1010 } { created_at: 2014-12-03, value:1012 } { created_at: 2014-12-03, value:1011 } { created_at: 2014-12-04, value:1012 } I just want to have an output like: { created_at: