mysql - How to group by only date, no datetime on mongodb -


well, want fetching results grouped date(year, month , day), no datetime(h:i:s).

in mysql can write:

select count(1), date(created) views  owner = 1 group date(created); 

and mongo? well, have idea, dont work... dont know how set "date(created)"...

db.views.group({     "key": {         "created": true     },     "initial": {         "sum_id": 0     },     "reduce": function(obj, prev) {         prev.sum_id = prev.sum_id + 1;     },     "cond": {         "owner": 1     } }); 

please, if know how query grouped date, tell me, need... thanks


Comments

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -