I use Mongoose in my NodeJS, and I have a collection with documents that look like this -
var SomeSchema = new Schema({
date: {
type: Date,
default: new Date()
},
some_item: {
type: String
}
});
The date field contains date with the time component (for example, 2014-05-09 09:43:02.478Z). How do I get a count of distinct items for a given date, say 2014-05-08?
EDIT: Ideally, I would like to get a count of records for each distinct date.