MongoDB - Layout
I'm a newbie to MongoDB, so pardon me if I'm using wrong terminologies here.
Given the above layout (attached image), I need to come up with two queries:
Use case 1 : A query that would output the count of total number of elements under someArrayField for a given document identifier. For example, for the above layout, I expect the query to return 2 for someArrayField, because it has 2 elements under it as nested documents.
Use case 2 : A query that would output the count of total number of elements under someArrayField for every document under Collection_1 (Collection_1 can contain multiple documents with the similar layout).
I know, I need to somehow use "Aggregation Pipeline" to get the desired results, but due to the lack of experience with NoSQL, I'm struggling a bit here.
So, any help is greatly appreciated!
