Created
May 23, 2023 19:16
-
-
Save dzhuryn/aa1cdc8805501b79c011d13698ff3e2b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.threads.aggregate([ | |
{ | |
"$match": { | |
"ci": { | |
"$in": [ObjectId("60fefc1f535ed8596d08c151"), ObjectId("6102e3c4535ed8596d3723da"), ObjectId("612163ca535ed8596dd57732"), ObjectId("61216d9a535ed8596dd5d3a0"), ObjectId("6121762d535ed8596dd61f13"), ObjectId("6121d19d535ed8596dd8c7e8"), ObjectId("6121f226535ed8596dd9b0da"), ObjectId("6121f282535ed8596dd9b386"), ObjectId("61227509535ed8596dde2d40"), ObjectId("61227a35535ed8596dde637d"), ObjectId("61227ed2535ed8596ddea2d1"), ObjectId("6122b672535ed8596d0bda85"), ObjectId("612385b8535ed8596d56e6a9"), ObjectId("6124099c535ed8596d5bd76a"), ObjectId("61311e2a535ed8596dc35295"), ObjectId("61312b78535ed8596dc4a781"), ObjectId("61312e75535ed8596dc4eb72"), ObjectId("61313c49535ed8596dc6c06b"), ObjectId("61313d82535ed8596dc6eb85"), ObjectId("6131420c535ed8596dc77e46"), ObjectId("6132851f535ed8596deabc01"), ObjectId("6133e0fe535ed8596d1800a1"), ObjectId("6133e4f6535ed8596d185541"), ObjectId("6133e5c8535ed8596d1867fa"), ObjectId("6133e948535ed8596d18bd9c"), ObjectId("6133e9d2535ed8596d18cd36"), ObjectId("6133f1c2535ed8596d1a040d"), ObjectId("6133f26f535ed8596d1a4032"), ObjectId("6133f2f5535ed8596d1a57a4"), ObjectId("6133f3b9535ed8596d1a72f0"), ObjectId("6133f97e535ed8596d1afd1e"), ObjectId("6133fdea535ed8596d1b7187"), ObjectId("61340150535ed8596d1bd932"), ObjectId("6134033b535ed8596d1c116b"), ObjectId("61340809535ed8596d1cb160"), ObjectId("61342fae535ed8596d222f68"), ObjectId("61343c3d535ed8596d237372"), ObjectId("61346108535ed8596d2841d5"), ObjectId("61360bea535ed8596d5d3073"), ObjectId("61364898535ed8596d644793"), ObjectId("61366e86535ed8596d68a3b0"), ObjectId("61368513535ed8596d6b2b4c"), ObjectId("61368e55535ed8596d6c10da"), ObjectId("61368ea0535ed8596d6c182a"), ObjectId("61368f1f535ed8596d6c24a9"), ObjectId("6136918c535ed8596d6c565e"), ObjectId("61369213535ed8596d6c64dc"), ObjectId("61369dbb535ed8596d6d8ebf"), ObjectId("6136a599535ed8596d6e4747"), ObjectId("6136a908535ed8596d6e9dda"), ObjectId("6136b37e535ed8596d6fd3a2"), ObjectId("613750e7535ed8596d7f903c"), ObjectId("6137eb5a535ed8596d90addf"), ObjectId("6137fdae535ed8596d92c43f"), ObjectId("61380909535ed8596d942954"), ObjectId("6138338f535ed8596d98bc0c"), ObjectId("6139be10535ed8596dc3a1ab"), ObjectId("613b6c87535ed8596df6fd7d"), ObjectId("613b7314535ed8596df770d1"), ObjectId("613b8dad535ed8596df9b6ab"), ObjectId("613b911a535ed8596df9e00e"), ObjectId("613b9eda535ed8596dfb275b"), ObjectId("613ba24c535ed8596dfb5d48"), ObjectId("613ba2ad535ed8596dfb61b9"), ObjectId("613baee3535ed8596dfc2402"), ObjectId("613bb8a1535ed8596dfcf747"), ObjectId("613bb944535ed8596dfd0669"), ObjectId("613bb98b535ed8596dfd0b54"), ObjectId("613bc385535ed8596dfddc34"), ObjectId("613bc498535ed8596dfdf45d"), ObjectId("613bccbc535ed8596dfed677"), ObjectId("613bd1e2535ed8596dff41bb"), ObjectId("613c3ad3535ed8596d07be28"), ObjectId("613c6823535ed8596d0c098e"), ObjectId("613cfd4d535ed8596d1d2130"), ObjectId("6140c964535ed8596d695dd3"), ObjectId("6140fdcf535ed8596d6c2bbe"), ObjectId("614129df535ed8596d6ea37d"), ObjectId("61412e4f535ed8596d6edb72"), ObjectId("61412f8a535ed8596d6ef735"), ObjectId("6141309b535ed8596d6f0196"), ObjectId("61413113535ed8596d6f0594"), ObjectId("614132b7535ed8596d6f18bc"), ObjectId("61413305535ed8596d6f1e29"), ObjectId("61413339535ed8596d6f22e0"), ObjectId("6141389b535ed8596d6fa68f"), ObjectId("61413c5a535ed8596d6ff629"), ObjectId("61413d5f535ed8596d700ac0"), ObjectId("61413eaa535ed8596d703591"), ObjectId("61414f2e535ed8596d71390f"), ObjectId("61415043535ed8596d71469c"), ObjectId("61416206535ed8596d726acd"), ObjectId("614167d4535ed8596d72ced4"), ObjectId("61417539535ed8596d74025b"), ObjectId("6141d65f535ed8596d799265"), ObjectId("6141ec32535ed8596d7acecf"), ObjectId("61420f02535ed8596d7ca548"), ObjectId("61427a00535ed8596d838702"), ObjectId("61427aa9535ed8596d838e41"), ObjectId("61427e80535ed8596d83bc1a"), ObjectId("6142823a535ed8596d83ef0e"), ObjectId("61428776535ed8596d843557"), ObjectId("614287dc535ed8596d843b76"), ObjectId("61428800535ed8596d843d5f"), ObjectId("61428ba6535ed8596d847366"), ObjectId("61428dc3535ed8596d84ac55"), ObjectId("61429425535ed8596d8511b9"), ObjectId("614294ec535ed8596d851be2"), ObjectId("61429ac7535ed8596d857562"), ObjectId("6142a17c535ed8596d85daf3"), ObjectId("6142ae2a535ed8596d86aa41"), ObjectId("6142b4a9535ed8596d870363"), ObjectId("6142cbe7535ed8596d887597"), ObjectId("614332d6535ed8596d8e0867"), ObjectId("6143a485535ed8596d94990d"), ObjectId("6143d6d5535ed8596d97d0df"), ObjectId("6143de08535ed8596d983b2e"), ObjectId("6143e090535ed8596d987293"), ObjectId("6143f846535ed8596d9a30f0"), ObjectId("6143f920535ed8596d9a42cd"), ObjectId("6144e8df535ed8596da799c5"), ObjectId("61450e78535ed8596daa8db8"), ObjectId("6145120d535ed8596daad1f5"), ObjectId("61453138535ed8596dad0d5b"), ObjectId("614543bf535ed8596dae83e2"), ObjectId("61459771535ed8596db4640a"), ObjectId("6145c446535ed8596db77595"), ObjectId("6145ca72535ed8596db7d9fe"), ObjectId("6145cf1d535ed8596db820d9"), ObjectId("6145d458535ed8596db8714e"), ObjectId("6145d756535ed8596db8afec"), ObjectId("6145dbcb535ed8596db8fdd4"), ObjectId("6145e7a7535ed8596db9ad60"), ObjectId("6145fc2d535ed8596dbb027d"), ObjectId("6145fc90535ed8596dbb0921"), ObjectId("61460925535ed8596dbbd1b1"), ObjectId("614609a1535ed8596dbbda5d"), ObjectId("614610c3535ed8596dbc52ee"), ObjectId("6146131f535ed8596dbc8156"), ObjectId("61462e5d535ed8596dbe2d03"), ObjectId("61464930535ed8596dc01273"), ObjectId("614653ff535ed8596dc0ed17"), ObjectId("61465c7b535ed8596dc171d5"), ObjectId("6146670c535ed8596dc22c90"), ObjectId("61466b5f535ed8596dc26fd3"), ObjectId("61466c0c535ed8596dc27ccf"), ObjectId("61467001535ed8596dc2c1dd"), ObjectId("61467286535ed8596dc2efb0"), ObjectId("614676e9535ed8596dc3480a"), ObjectId("614680c0535ed8596dc401a2"), ObjectId("614680e3535ed8596dc403c7"), ObjectId("61468469535ed8596dc47d6b"), ObjectId("61468eef535ed8596dc5a981"), ObjectId("61468f7d535ed8596dc5c0e4"), ObjectId("6146a741535ed8596dc7acd1"), ObjectId("6146a9e8535ed8596dc7d85b"), ObjectId("6146b33e535ed8596dc883ec"), ObjectId("6146b4a0535ed8596dc8a55f"), ObjectId("6146b772535ed8596dc8e30d"), ObjectId("6146c442535ed8596dc9e16f"), ObjectId("6146d69b535ed8596dcb2e0d"), ObjectId("6147ce93535ed8596ddceff9"), ObjectId("6147ef68535ed8596de0026c"), ObjectId("61484a5c535ed8596de7d124"), ObjectId("614872c5535ed8596deb2bc8"), ObjectId("6148863f535ed8596decc2b3"), ObjectId("6148cd5e535ed8596df1d613"), ObjectId("6148d9d4535ed8596df2b25f"), ObjectId("6148e0d6535ed8596df32771"), ObjectId("6148f98f535ed8596df50b0c"), ObjectId("6148ffa3535ed8596df57694"), ObjectId("61490967535ed8596df62b69"), ObjectId("61490a19535ed8596df63964"), ObjectId("61490a6e535ed8596df640bb"), ObjectId("61490fec535ed8596df6a56f"), ObjectId("61491f4d535ed8596df7e264"), ObjectId("61492b4e535ed8596df8f95e"), ObjectId("61492dfa535ed8596df937c7"), ObjectId("61493b8c535ed8596dfa8485"), ObjectId("6149bf69535ed8596d031d67"), ObjectId("614a24b8535ed8596d0ad993"), ObjectId("614a5efa535ed8596d0f137e"), ObjectId("614a6ee2535ed8596d104100"), ObjectId("614a6f12535ed8596d1044e9"), ObjectId("614a7b26535ed8596d114baa"), ObjectId("614a8afc535ed8596d128ce8"), ObjectId("614a900e535ed8596d1342f7"), ObjectId("614a9799535ed8596d13e558"), ObjectId("614ae862535ed8596d1a3ef0"), ObjectId("614b8638535ed8596d2571e7"), ObjectId("614bd737535ed8596d2baea2"), ObjectId("614bdce7535ed8596d2c2ce9"), ObjectId("614bed6c535ed8596d2d6901"), ObjectId("614bf7d4535ed8596d2e333d"), ObjectId("614d0c29535ed8596d43bddf"), ObjectId("614d1cc3535ed8596d455345"), ObjectId("614d4f77535ed8596d494a4a"), ObjectId("614e620d535ed8596d59cc6b"), ObjectId("614e687e535ed8596d5a504d"), ObjectId("614f9983535ed8596d711b70"), ObjectId("614fa291535ed8596d71a801"), ObjectId("614fa2da535ed8596d71ade6"), ObjectId("614fa336535ed8596d71b4e9"), ObjectId("614fa634535ed8596d71f435"), ObjectId("614fa682535ed8596d71f97f"), ObjectId("6150341b535ed8596d7f5c58"), ObjectId("6150d3d9535ed8596d1a2244"), ObjectId("6152b85b535ed8596d939261"), ObjectId("6152f443535ed8596d9f8e1b"), ObjectId("6153fe67535ed8596dcea722")] | |
} | |
} | |
}, | |
{ | |
"$project": { | |
"_id": 0, | |
"ui": 1, | |
"tc": { | |
"$literal": 1 | |
} | |
} | |
}, | |
{ | |
"$unionWith": { | |
"coll": "replies", | |
"pipeline": [ | |
{ | |
"$match": { | |
"ci": { | |
"$in": [ObjectId("60fefc1f535ed8596d08c151"), ObjectId("6102e3c4535ed8596d3723da"), ObjectId("612163ca535ed8596dd57732"), ObjectId("61216d9a535ed8596dd5d3a0"), ObjectId("6121762d535ed8596dd61f13"), ObjectId("6121d19d535ed8596dd8c7e8"), ObjectId("6121f226535ed8596dd9b0da"), ObjectId("6121f282535ed8596dd9b386"), ObjectId("61227509535ed8596dde2d40"), ObjectId("61227a35535ed8596dde637d"), ObjectId("61227ed2535ed8596ddea2d1"), ObjectId("6122b672535ed8596d0bda85"), ObjectId("612385b8535ed8596d56e6a9"), ObjectId("6124099c535ed8596d5bd76a"), ObjectId("61311e2a535ed8596dc35295"), ObjectId("61312b78535ed8596dc4a781"), ObjectId("61312e75535ed8596dc4eb72"), ObjectId("61313c49535ed8596dc6c06b"), ObjectId("61313d82535ed8596dc6eb85"), ObjectId("6131420c535ed8596dc77e46"), ObjectId("6132851f535ed8596deabc01"), ObjectId("6133e0fe535ed8596d1800a1"), ObjectId("6133e4f6535ed8596d185541"), ObjectId("6133e5c8535ed8596d1867fa"), ObjectId("6133e948535ed8596d18bd9c"), ObjectId("6133e9d2535ed8596d18cd36"), ObjectId("6133f1c2535ed8596d1a040d"), ObjectId("6133f26f535ed8596d1a4032"), ObjectId("6133f2f5535ed8596d1a57a4"), ObjectId("6133f3b9535ed8596d1a72f0"), ObjectId("6133f97e535ed8596d1afd1e"), ObjectId("6133fdea535ed8596d1b7187"), ObjectId("61340150535ed8596d1bd932"), ObjectId("6134033b535ed8596d1c116b"), ObjectId("61340809535ed8596d1cb160"), ObjectId("61342fae535ed8596d222f68"), ObjectId("61343c3d535ed8596d237372"), ObjectId("61346108535ed8596d2841d5"), ObjectId("61360bea535ed8596d5d3073"), ObjectId("61364898535ed8596d644793"), ObjectId("61366e86535ed8596d68a3b0"), ObjectId("61368513535ed8596d6b2b4c"), ObjectId("61368e55535ed8596d6c10da"), ObjectId("61368ea0535ed8596d6c182a"), ObjectId("61368f1f535ed8596d6c24a9"), ObjectId("6136918c535ed8596d6c565e"), ObjectId("61369213535ed8596d6c64dc"), ObjectId("61369dbb535ed8596d6d8ebf"), ObjectId("6136a599535ed8596d6e4747"), ObjectId("6136a908535ed8596d6e9dda"), ObjectId("6136b37e535ed8596d6fd3a2"), ObjectId("613750e7535ed8596d7f903c"), ObjectId("6137eb5a535ed8596d90addf"), ObjectId("6137fdae535ed8596d92c43f"), ObjectId("61380909535ed8596d942954"), ObjectId("6138338f535ed8596d98bc0c"), ObjectId("6139be10535ed8596dc3a1ab"), ObjectId("613b6c87535ed8596df6fd7d"), ObjectId("613b7314535ed8596df770d1"), ObjectId("613b8dad535ed8596df9b6ab"), ObjectId("613b911a535ed8596df9e00e"), ObjectId("613b9eda535ed8596dfb275b"), ObjectId("613ba24c535ed8596dfb5d48"), ObjectId("613ba2ad535ed8596dfb61b9"), ObjectId("613baee3535ed8596dfc2402"), ObjectId("613bb8a1535ed8596dfcf747"), ObjectId("613bb944535ed8596dfd0669"), ObjectId("613bb98b535ed8596dfd0b54"), ObjectId("613bc385535ed8596dfddc34"), ObjectId("613bc498535ed8596dfdf45d"), ObjectId("613bccbc535ed8596dfed677"), ObjectId("613bd1e2535ed8596dff41bb"), ObjectId("613c3ad3535ed8596d07be28"), ObjectId("613c6823535ed8596d0c098e"), ObjectId("613cfd4d535ed8596d1d2130"), ObjectId("6140c964535ed8596d695dd3"), ObjectId("6140fdcf535ed8596d6c2bbe"), ObjectId("614129df535ed8596d6ea37d"), ObjectId("61412e4f535ed8596d6edb72"), ObjectId("61412f8a535ed8596d6ef735"), ObjectId("6141309b535ed8596d6f0196"), ObjectId("61413113535ed8596d6f0594"), ObjectId("614132b7535ed8596d6f18bc"), ObjectId("61413305535ed8596d6f1e29"), ObjectId("61413339535ed8596d6f22e0"), ObjectId("6141389b535ed8596d6fa68f"), ObjectId("61413c5a535ed8596d6ff629"), ObjectId("61413d5f535ed8596d700ac0"), ObjectId("61413eaa535ed8596d703591"), ObjectId("61414f2e535ed8596d71390f"), ObjectId("61415043535ed8596d71469c"), ObjectId("61416206535ed8596d726acd"), ObjectId("614167d4535ed8596d72ced4"), ObjectId("61417539535ed8596d74025b"), ObjectId("6141d65f535ed8596d799265"), ObjectId("6141ec32535ed8596d7acecf"), ObjectId("61420f02535ed8596d7ca548"), ObjectId("61427a00535ed8596d838702"), ObjectId("61427aa9535ed8596d838e41"), ObjectId("61427e80535ed8596d83bc1a"), ObjectId("6142823a535ed8596d83ef0e"), ObjectId("61428776535ed8596d843557"), ObjectId("614287dc535ed8596d843b76"), ObjectId("61428800535ed8596d843d5f"), ObjectId("61428ba6535ed8596d847366"), ObjectId("61428dc3535ed8596d84ac55"), ObjectId("61429425535ed8596d8511b9"), ObjectId("614294ec535ed8596d851be2"), ObjectId("61429ac7535ed8596d857562"), ObjectId("6142a17c535ed8596d85daf3"), ObjectId("6142ae2a535ed8596d86aa41"), ObjectId("6142b4a9535ed8596d870363"), ObjectId("6142cbe7535ed8596d887597"), ObjectId("614332d6535ed8596d8e0867"), ObjectId("6143a485535ed8596d94990d"), ObjectId("6143d6d5535ed8596d97d0df"), ObjectId("6143de08535ed8596d983b2e"), ObjectId("6143e090535ed8596d987293"), ObjectId("6143f846535ed8596d9a30f0"), ObjectId("6143f920535ed8596d9a42cd"), ObjectId("6144e8df535ed8596da799c5"), ObjectId("61450e78535ed8596daa8db8"), ObjectId("6145120d535ed8596daad1f5"), ObjectId("61453138535ed8596dad0d5b"), ObjectId("614543bf535ed8596dae83e2"), ObjectId("61459771535ed8596db4640a"), ObjectId("6145c446535ed8596db77595"), ObjectId("6145ca72535ed8596db7d9fe"), ObjectId("6145cf1d535ed8596db820d9"), ObjectId("6145d458535ed8596db8714e"), ObjectId("6145d756535ed8596db8afec"), ObjectId("6145dbcb535ed8596db8fdd4"), ObjectId("6145e7a7535ed8596db9ad60"), ObjectId("6145fc2d535ed8596dbb027d"), ObjectId("6145fc90535ed8596dbb0921"), ObjectId("61460925535ed8596dbbd1b1"), ObjectId("614609a1535ed8596dbbda5d"), ObjectId("614610c3535ed8596dbc52ee"), ObjectId("6146131f535ed8596dbc8156"), ObjectId("61462e5d535ed8596dbe2d03"), ObjectId("61464930535ed8596dc01273"), ObjectId("614653ff535ed8596dc0ed17"), ObjectId("61465c7b535ed8596dc171d5"), ObjectId("6146670c535ed8596dc22c90"), ObjectId("61466b5f535ed8596dc26fd3"), ObjectId("61466c0c535ed8596dc27ccf"), ObjectId("61467001535ed8596dc2c1dd"), ObjectId("61467286535ed8596dc2efb0"), ObjectId("614676e9535ed8596dc3480a"), ObjectId("614680c0535ed8596dc401a2"), ObjectId("614680e3535ed8596dc403c7"), ObjectId("61468469535ed8596dc47d6b"), ObjectId("61468eef535ed8596dc5a981"), ObjectId("61468f7d535ed8596dc5c0e4"), ObjectId("6146a741535ed8596dc7acd1"), ObjectId("6146a9e8535ed8596dc7d85b"), ObjectId("6146b33e535ed8596dc883ec"), ObjectId("6146b4a0535ed8596dc8a55f"), ObjectId("6146b772535ed8596dc8e30d"), ObjectId("6146c442535ed8596dc9e16f"), ObjectId("6146d69b535ed8596dcb2e0d"), ObjectId("6147ce93535ed8596ddceff9"), ObjectId("6147ef68535ed8596de0026c"), ObjectId("61484a5c535ed8596de7d124"), ObjectId("614872c5535ed8596deb2bc8"), ObjectId("6148863f535ed8596decc2b3"), ObjectId("6148cd5e535ed8596df1d613"), ObjectId("6148d9d4535ed8596df2b25f"), ObjectId("6148e0d6535ed8596df32771"), ObjectId("6148f98f535ed8596df50b0c"), ObjectId("6148ffa3535ed8596df57694"), ObjectId("61490967535ed8596df62b69"), ObjectId("61490a19535ed8596df63964"), ObjectId("61490a6e535ed8596df640bb"), ObjectId("61490fec535ed8596df6a56f"), ObjectId("61491f4d535ed8596df7e264"), ObjectId("61492b4e535ed8596df8f95e"), ObjectId("61492dfa535ed8596df937c7"), ObjectId("61493b8c535ed8596dfa8485"), ObjectId("6149bf69535ed8596d031d67"), ObjectId("614a24b8535ed8596d0ad993"), ObjectId("614a5efa535ed8596d0f137e"), ObjectId("614a6ee2535ed8596d104100"), ObjectId("614a6f12535ed8596d1044e9"), ObjectId("614a7b26535ed8596d114baa"), ObjectId("614a8afc535ed8596d128ce8"), ObjectId("614a900e535ed8596d1342f7"), ObjectId("614a9799535ed8596d13e558"), ObjectId("614ae862535ed8596d1a3ef0"), ObjectId("614b8638535ed8596d2571e7"), ObjectId("614bd737535ed8596d2baea2"), ObjectId("614bdce7535ed8596d2c2ce9"), ObjectId("614bed6c535ed8596d2d6901"), ObjectId("614bf7d4535ed8596d2e333d"), ObjectId("614d0c29535ed8596d43bddf"), ObjectId("614d1cc3535ed8596d455345"), ObjectId("614d4f77535ed8596d494a4a"), ObjectId("614e620d535ed8596d59cc6b"), ObjectId("614e687e535ed8596d5a504d"), ObjectId("614f9983535ed8596d711b70"), ObjectId("614fa291535ed8596d71a801"), ObjectId("614fa2da535ed8596d71ade6"), ObjectId("614fa336535ed8596d71b4e9"), ObjectId("614fa634535ed8596d71f435"), ObjectId("614fa682535ed8596d71f97f"), ObjectId("6150341b535ed8596d7f5c58"), ObjectId("6150d3d9535ed8596d1a2244"), ObjectId("6152b85b535ed8596d939261"), ObjectId("6152f443535ed8596d9f8e1b"), ObjectId("6153fe67535ed8596dcea722")] | |
} | |
} | |
}, | |
{ | |
"$project": { | |
"_id": 0, | |
"ui": 1, | |
"rc": { | |
"$literal": 1 | |
} | |
} | |
} | |
] | |
} | |
}, | |
{ | |
"$group": { | |
"_id": "$ui", | |
"tc": { | |
"$sum": "$tc" | |
}, | |
"rc": { | |
"$sum": "$rc" | |
} | |
} | |
}, | |
{ | |
"$sort": { | |
"tc": -1 | |
} | |
}, | |
{ | |
"$limit": 105 | |
} | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment