mongodb $group compare one collection to other collection
问题 I got stuck in one point. See this playground, it should follow this logic: if history's collection is empty, return data if history's date collection is greater then main's collection base on specified user_id , return nothing if specified user_id doesn't match with history's collection date then it should return all data that is in main collection. So everything looks fine in playground the only problem when i am putting 5e4e74eb380054797d9db623 id it should not return me data because its