how to run aggregate query in mongodb client on RockMongo or mViewer

前端 未结 1 1787
一整个雨季
一整个雨季 2021-01-06 04:03

I\'ve just started using mongo db, I\'m using rockmongo client and my ubuntu terminal as another client. I\' ve realized the query using group aggregation like this:

相关标签:
1条回答
  • 2021-01-06 04:08

    You can run aggregate query in "tools->command" panel in your homepage of rockmongo. You may enter query in the input panel like this:

    { 
      aggregate : "ns",                                          
      pipeline : [
                   ...
                 ]                
    }
    

    That will be ok! I have tried, and it works!

    Full Example:

    { aggregate : "COLLECTION_NAME",
      pipeline : [
        { $unwind : "$SUB_ARRAY" },
        { $match: {"SUB_ARRAY.field": "value"}},
      ]
    }
    
    0 讨论(0)
提交回复
热议问题