-
-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
QueryBuilder with a ParseObject encode to json not correct. #138
Comments
I don't quite understand the question, but I can see an error in your query
to begin with. Where you call:-
queryBuilder.whereEqualTo(
"book", ParseObject);
Try this instead :-
queryBuilder.whereEqualTo(
"book", ParseObject("Note"));n Sun, Mar 24, 2019, 09:32
炸鸡叔 <notifications@github.com> wrote:
I use queryBuilder build a query with ParseObject but get error Unexpected
… token _ in JSON at position from parse server .
I checked my request url the parseObject without quotes.
This is my code:
///build a query
var queryBuilder = QueryBuilder<ParseObject>(ParseObject("Note"));
....
///other query limit
....
queryBuilder.whereEqualTo(
"book", ParseObject);
My console out put:
....
....
where={"updatedAt":{ "$gt":{"__type":"Date","iso":"2019-03-23T16:00:00.000Z"}, "$lt":{"__type":"Date","iso":"2019-03-24T15:59:59.000Z"}},"book": {__type: Pointer, className: Books, objectId: HZ09pN5NXI}}&skip=0
The book object without quote.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#138>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AHgn3rPbe3cO_spU-hp7AQPjQG-vGACRks5vZ0ZJgaJpZM4cFZvP>
.
|
Sorry for my poor english. |
Oh right, so none of the elements in the books JSON object are wrapped in quotation marks? |
Yes |
Very strange. What's happens if you create an instance of a Note object and call .toPointer in the whereEqualTo call? |
Oh strange.
my code:
|
I'll look into that.
It probably should be the same output but it looks to be slightly different.
…On Sun, Mar 24, 2019, 10:10 炸鸡叔 ***@***.***> wrote:
Oh strange.
Everything works fine when I manually call toPointer.This my console
output:
where={"updatedAt":{ "$gt":{"__type":"Date","iso":"2019-03-23T16:00:00.000Z"}, "$lt":{"__type":"Date","iso":"2019-03-24T15:59:59.000Z"}},"book": {"__type":"Pointer","className":"Books","objectId":"HZ09pN5NXI"}}&skip=0
my code:
...
queryBuilder.whereEqualTo(
"book",book.toPointer());
...
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#138 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHgn3vjMtqVHLSKohWPbc-J2jschY8w8ks5vZ08RgaJpZM4cFZvP>
.
|
But when I manually call toPointer, the parse server will not response an error. |
@zakiso The problem with pointers has been resolved. The correct it use: queryBuilder.whereEqualTo("field", Object.toPointer()); |
@RodrigoSMarques |
@phillwiggins |
When I use queryBuilder build a query and query condition contains a ParseObject then the server response a error. The error is
Unexpected token _ in JSON at position
.This is my code:
My console out put:
The text was updated successfully, but these errors were encountered: