'how do i execute mongodb-compass pipeline code under documents tab

Is it possible to execute MongoDB Compass pipeline code (under aggregations tab ) in the Documents tab? I have tried putting:

[{$group: {
 _id: {
  api: '$api'
 },
 count: {
  $sum: 1
 }
}}]

and

aggregate([{$group: {
 _id: {
  api: '$api'
 },
 count: {
  $sum: 1
 }
}}])


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source