As mentioned.
MongoDB can use the count method to count the number of documents in a collection, which is a collection method, but how to count the number of embedded sub-documents? I checked the official documentation and couldn't find a suitable method in the aggregation framework. I hope someone can give me some advice.