Skip to content

Instantly share code, notes, and snippets.

View Rishabh570's full-sized avatar
👋

Rishabh Rawat Rishabh570

👋
View GitHub Profile
{
"name": "Spidey One way home",
"release_year": "2021",
"rating": 9,
"starring": [
"Tom Hanks",
"Tom Holland",
"Mark Zucks",
"Samy"
],
{
"$group": {
"_id": "$release_year"
}
}
[
{ "_id": "1896" },
{ "_id": "2016" },
{ "_id": "2021" },
{ "_id": "2005" }
]
{
"$group": {
"_id": {
"release_year": "$release_year",
"runtime": "$runtime"
}
}
}
[
{
"_id": {
"release_year": "2005",
"runtime": 150
}
},
{
"_id": {
"release_year": "2021",
{
"$group": {
"_id": "$release_year",
"totalMovies": { "$count": {} }
}
}
[
{
"_id": "2016",
"totalMovies": 1
},
{
"_id": "1896",
"totalMovies": 1
},
{
{
"$group": {
"_id": "$rating",
"totalMovies": {
"$sum": "$totalReviews"
}
}
}
[
{
"_id": 9,
"totalMovies": 2000
},
{
"_id": 6,
"totalMovies": 720
},
{
{
"$group": {
"_id": {
"year": "$release_year",
},
"avgRating": {
"$avg": "$rating"
}
}
}