Unable to create variable from MongoDB

hi,
I am using mongodb community plugin to connect to grafana. i am running below query but it gives me error -
i am adding below text in my aggregation -
[
{
“$match”: {
“vid.sim”: { “$ne”: null }
}
},
{
“$group”: {
“_id”: “$vid.sim”
}
},
{
“$project”: {
“value”: “$_id”,
“label”: “$_id”
}
},
{
“$sort”: {
“value”: 1
}
}
]
this aggregation gives me the output of all sim in mongodb compass but when i run the same query in aggregations section of variable setting in grafana it gives me error -
Templating [sim]
Error updating options: Failed to convert document number 0: Failed to extract value columns: Field vin was null or absent, but is not nullable. If using schema inference, please increase the depth to the first document missing this field, or manually specify the schema, map[_id:SM1 label:SM1 value:SM1]. can someone please help on this ?