parse-server
parse-server copied to clipboard
Add a comment field in queries
Hi,
For my clients, I monitor their MongoDB Atlas cluster using the Profiler, which shows a graph of all slow queries. When I see a slow query, it's hard for me to know where it comes from, in the codebase. We have many coders in many projects that all use the Parse JS SDK. MongoDB query options have a comment field. It would be great to have it in Parse.
Thx
Olivier
Thanks for opening this issue!
I assume you mean $comment?
Seems like a useful feature, could be implemented like:
const query = new Parse.Query('Test');
query.comment('...');
For the aggregation pipeline this should be already supported. For the Parse JS SDK this requires changes in Parse Server and the Parse JS SDK.
It could be coded by taking 'hint' as an example.
🎉 This change has been released in version 7.0.0-alpha.23
@Meglali20 Could you please take a look at the tests in #8928? After merging, it seems that the tests are flaky, see for example https://github.com/parse-community/parse-server/actions/runs/8238148925/job/22528520534. It's not just that one test, but various comment related tests, so it seems to be a general issue with the test structure. Maybe you need to await something, or add a delay somewhere if await is not possible. It could of course also be an issue with the feature itself, but flakiness is usually a testing issue.
When you said various comment related tests are failing, can you confirm whether all tests are failing or only one test fails and the other succeeds?
Different comment relates tests were failing, sometimes the comment with count, sometimes other ones. It just seems flaky, see the links.
I checked the failing workflows and I can see that only one test fails at a time, I think it's because of the profiler not being enabled correctly, I will make a PR with updated tests.
🎉 This change has been released in version 7.0.0-beta.1
🎉 This change has been released in version 7.0.0