I have such this type of structure of my database. I want to find number of documents my \"JAN\" array contains. I am trying to do in different way but nothing works. That w
You can use $size operator to find the length of the array
db.collection.aggregate([ { "$project": { "totalJan": { "$size": "$2017.JAN" } } } ])
MongoPlayground