JamesOsgood / mongodb-grafana

MongoDB plugin for Grafana
MIT License
464 stars 213 forks source link

Is $unwind supported? #134

Open adamxyzxyz opened 2 years ago

adamxyzxyz commented 2 years ago

Hello,

I am running a query on grafana cloud to get data inside a nested document, the query is below

db.data.aggregate(
  [
    { 
    $limit: 1 
    },
    {
      $unwind: "$data_field"
    },
    {"$project": {
      "1": "$data_field.1",
      "2": "$data_fields.2",
      "3": "$data_field.3",
      "4": "$data_field.4",
      "5": "$data_field.5"
      }
    },
    {$sort: {datetime: -1}}
  ]
)

As usual, this query doesn't work with this plugin. Is the unwind feature supported?