parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

Add a comment field in queries

Open oallouch opened this issue 2 years ago • 3 comments

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

oallouch avatar Nov 01 '23 23:11 oallouch

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.

mtrezza avatar Nov 02 '23 00:11 mtrezza

It could be coded by taking 'hint' as an example.

oallouch avatar Nov 02 '23 15:11 oallouch

🎉 This change has been released in version 7.0.0-alpha.23

parseplatformorg avatar Mar 03 '24 01:03 parseplatformorg

@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.

mtrezza avatar Mar 11 '24 20:03 mtrezza

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?

Meglali20 avatar Mar 12 '24 15:03 Meglali20

Different comment relates tests were failing, sometimes the comment with count, sometimes other ones. It just seems flaky, see the links.

mtrezza avatar Mar 12 '24 18:03 mtrezza

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.

Meglali20 avatar Mar 12 '24 19:03 Meglali20

🎉 This change has been released in version 7.0.0-beta.1

parseplatformorg avatar Mar 19 '24 18:03 parseplatformorg

🎉 This change has been released in version 7.0.0

parseplatformorg avatar Mar 19 '24 20:03 parseplatformorg