Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QueryBuilder().count() does not work when we add QueryBuilder().whereWithinKilometers() query for parse objects. #964

Open
4 tasks done
hgandhi67 opened this issue Aug 10, 2023 · 4 comments
Labels
bounty:$20 Bounty applies for fixing this issue (Parse Bounty Program) type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@hgandhi67
Copy link

Issue Description

QueryBuilder().count() method does not work when we add whereWithinKilometers() query for any parse objects in QueryBuilder.or(EventsModel(),[query1 , query2]).

It returns InternalServerError, where as QueryBuilder().query() works completely fine in QueryBuilder.or(EventsModel(),[query1 , query2]) and returns the results as expected.

Steps to reproduce

final query1 = QueryBuilder(EventsModel());
query1.whereEqualTo(keyStatus, EVENT_STATUS_APPROVED);
query1.whereGreaterThanOrEqualsTo(keyDate, oneHrBeforeTime);
query1.whereContainedIn(keyEventStatus, [EVENT_STATUS_ONGOING, EVENT_STATUS_RESCHEDULED]);

final query2 = QueryBuilder(EventsModel());
query2.whereValueExists(keyRecurrentEvent, true);
query2.whereEqualTo(keyRecurrentEvent, true);
query2.whereEqualTo(keyStatus, EVENT_STATUS_APPROVED);
query2.whereContainedIn(keyEventStatus, [EVENT_STATUS_ONGOING, EVENT_STATUS_RESCHEDULED]);

final mergedQuery = QueryBuilder.or(EventsModel(), [query1, query2]);
mergedQuery.whereWithinKilometers(keyGeoPoint, currentUser.getGeoPoint!, 100);
mergedQuery.orderByDescending(EventsModel.keyTime);
mergedQuery.setLimit(100);

final response = await mergedQuery.count();

Actual Outcome

Status Code: 1
Type: InternalServerError
Error: null

image

Expected Outcome

Function: ParseApiRQ.query
Status Code: 200
Payload: [EventsModel(), EventsModel(), EventsModel()]

Environment

Parse Flutter SDK

  • SDK version: 5.1.2
  • Flutter version: 3.7.12
  • Dart version: 2.19.6
  • Operating system version: Mobile

Server

  • Parse Server version: 5.1.2

Logs

image

@parse-github-assistant
Copy link

Thanks for opening this issue!

@hgandhi67
Copy link
Author

Any updates on this issue??

@mtrezza mtrezza added the type:bug Impaired feature or lacking behavior that is likely assumed label Sep 15, 2023
@hgandhi67
Copy link
Author

Do we have any timeline on this issue please? or any updates?

@zahidshaikh08
Copy link

Any updates on this?

@mtrezza mtrezza added the bounty:$20 Bounty applies for fixing this issue (Parse Bounty Program) label Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty:$20 Bounty applies for fixing this issue (Parse Bounty Program) type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

3 participants