parse-community / Parse-SDK-Flutter

The Dart/Flutter SDK for Parse Platform
https://parseplatform.org
Apache License 2.0
573 stars 188 forks source link

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

Closed hgandhi67 closed 1 year ago

hgandhi67 commented 1 year ago

New Issue Checklist

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

Server

Logs

image

parse-github-assistant[bot] commented 1 year ago

Thanks for opening this issue!

mtrezza commented 1 year ago

I'm closing this as it does not use the issue template provided when creating an issue and therefore lacks essential information required to investigate the issue. Please edit your initial post using the issue template and we can re-open this issue.