how to add same fields from different collection of same db in mongo chrat

Viewed 42

I am trying to draw some mongo chart, I have db called user_activities with user based collections, each collection has field called count, now I need to write a single chart which can show the total count of user activities from all user collections, I tried below query in query tab but getting below error

(BadValue) unknown top level operator: $lookup

{
    $lookup:{
        from: "name_123",      
        localField: "count",  
        foreignField: "name_345.count",  
        as: "SingleCount"         
    }
} 

How to give multiple collections of same db in single chart for some aggregation or count ?

0 Answers
Related