19 Aggregation Example 9 $group and $count - MongoDB Aggregation Tutorial

preview_player
Показать описание

🔥 Discord community

🔥 Udemy Profile

SUBSCRIBE IN SOCIAL NETWORKS

Email 📧 in case you want to send me a notice
Рекомендации по теме
Комментарии
Автор

This video is part of my full-length course “MongoDB Essentials - Complete MongoDB Guide”.
In this course I teach all what you need to know about MongoDB and I start from the very beginning and explain how MongoDB works behind the scenes.

More than 7500 students have already joined it.
Go ahead and join too! Happy Learning!

Bogdan_Stashchuk
Автор

your videos are very informative. It was as if I was learning from Vladimir

nikhilnarayane
Автор

How to group inside a group and count? For example group by countries, then according to favorite fruits and count lovers of those.
Example in persons collection:
[{usa:{banana:55, apple:35}}, {italy:{banana:100, apple:95}}, ...]

GiorgiGvimradze
Автор

if the reulting documents is 0 , what if i want to return 0 how do i do it

pateltanaka
Автор

If i want to find count of each group then i'm using this stage : {$group: {_id: {age: "$age", count: {$sum:1}}}}
but it's not working

twinklegoyal
Автор

How can I show the total of age, and then the total of age the more than 25?

allaahmed
Автор

I tried using the count method in pandas, I keep getting this error;
AttributeError: 'Cursor' object has no attribute 'count'
This is the code;
dw_db = client.doctorwho
tc = dw_db.test_collection

tc.insert_one({'name': 'William', 'birthyear': 1908})

# Insert a few (zip takes some lists and returns a list of tuples)
for n, b in zip('Patrick Jon Tom Peter Colin Sylvester Paul Christopher David Matt Peter'.split(),
[1920, 1919, 1934, 1951, 1943, 1943, 1959, 1964, 1971, 1982, 1958]):
tc.insert_one({'name': n, 'birthyear': b})

dw_db.tc.find({'name': 'Peter'}).count()

zubee
Автор

How to write query for number of countries in each continent?

vasanthipulusu
Автор

But I don't think value returned by count() is equal to cartesian product value of fields in match i.e 3x2=6...It's a mere coincidence I think

nishantnimish
Автор

Query for the number of countries in each continent where there are multiple row on each country and continents

vasanthipulusu