sql - Translate query combined max and min from mysql to mongoDB -


my documents this:

{   "_id": objectid("5698fcb5585b2de0120eba31"),   "id": "26125242313",   "parent_id": "26125241841",   "link_id": "10024080",   "name": "26125242313",   "author": "gigaquack",   "body": "blogging = creative writing",   "subreddit_id": "6",   "subreddit": "reddit.com",   "score": "27",   "created_utc": "2007-10-22 18:39:31" } 

and using mysql databse. , use query:

select max(score), author (select sum(score) score, author author reddit author in  (select distinct author reddit) group author) union select min(score), author (select sum(score) score,  author author reddit author in  (select distinct author reddit) group author)  

now want translate query mongodb. how should that? sorry unclear question. want query calculates how score users have , show max combined score , min combined score username. like:

 xxxx|150   yyyy|2  


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -