I tried using query.distinct() as per documentation. But I get a warning that I should add the leading $ sign to it. Which breaks the query. What is the new proper way of getting distinct values without aggregation pipeline?
const sQuery = new Parse.Query("Deliveries");
sQuery.equalTo("user", req.user);
sQuery.greaterThan("createdAt", new Date(timeframe));
sQuery.equalTo("status", "accepted");
sQuery.distinct("donator");
const totalDonatorsHelped = await sQuery.count({ useMasterKey: true });
What versions of the JS SDK and Parse Server are you using? This would most likely be fixed by updating your JS SDK to the latest version
1 Like
You’re right, it’s been fixed in version 6. I’ll pay attention in the future. Thank you.
Upgrading to 6.0. caused this Error: Router.use() requires a middleware function but got an object
I opened an issue on GitHub.
Please review the migration guide when updating major versions, as major versions have breaking changes:
# Parse Server 6 Migration Guide <!-- omit in toc -->
This document only highlights specific changes that require a longer explanation. For a full list of changes in Parse Server 6 please refer to the [changelog](https://github.com/parse-community/parse-server/blob/alpha/CHANGELOG.md).
---
- [Incompatible git protocol with Node 14](#incompatible-git-protocol-with-node-14)
- [Import Statement](#import-statement)
- [Asynchronous Initialization](#asynchronous-initialization)
---
## Incompatible git protocol with Node 14
Parse Server 6 uses the Node Package Manger (npm) package lock file version 2. While version 2 is supposed to be backwards compatible with version 1, you may still encounter errors due to incompatible git protocols that cannot be interpreted correctly by npm bundled with Node 14.
If you are encountering issues installing Parse Server on Node 14 because of dependency references in the package lock file using the `ssh` protocol, configure git to use the `https` protocol instead:
```
sudo git config --system url."https://github".insteadOf "ssh://git@github"
This file has been truncated. show original
1 Like
This one helped. Thanks a lot.
In the migration guide this line const ParseServer = require("parse-server")
needs to be swapped with const ParseServer = require("parse-server").ParseServer;
Otherwise it gives ParseServer is not a constructor error.
JFYI