parse-community / parse-community/parse-server
Aggregate cannot correctly aggregate date fields
Open
Nobody has claimed this yet.
type:bug
- Dominant language
- JavaScript
- Stars
- 21.4k
- Forks
- 4.8k
- Avg merge
- 7h 45m
- Merged PRs (30d)
- 11
Description
Issue Description
I need to count the new data every day
group: {
objectId: { day: { $dayOfMonth: "$createdAt" }, month: { $month: "$createdAt" }, year: { $year: "$createdAt" } },
count: { $sum: 1 },
},
Result:

Expected Results
Count the same date together
Environment Setup
-
Server
- parse-server version (Be specific! Don't say 'latest'.) : 3.0.8&4.2.0
- Operating System: ubuntu
-
Database
Postgresql 10
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the provided aggregation with parse-server 3.0.8/4.2.0 and PostgreSQL 10, using the $dayOfMonth, $month, and $year expressions on createdAt. Compare the resulting groups with the expected calendar-date grouping; done means records from the same date are counted together.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, postgresql
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100