Parse.com Using the Javascript SDK includes but does not work

I am trying to retrieve data from a table named Book . Inside the Book there is a Pointer<ParseUser> , which contains a single user pointer. ParseUser has another pointer called Pais (which means "Country in Spanish"). Therefore, I want to receive every information from any Book :

 var query = new Parse.Query("Book"); query.include("user"); query.include("user.pais"); query.find({ success: function(books) { response.success(books); }, error: function(error) { response.error({'resp': error.code, 'message': error.message}); } }); 

and I don't get objects, just pointers:

enter image description here

Why? I know that it works fine when I call it on iOS or Android using include(String key) or includeKey: NSString* key .

Why doesn't it work with Javascript ??

Thanks in advance.

Sincerely.

Raphael.


EDIT:

Oh, and I just forgot ... I tried:

query.include(["user"]);

and

query.include(["user", "user.pais"]);

I saw some examples where developers used it.


SECOND EDIT:

The last thing I used was fetch like:

 Parse.Object.fetchAll(books, { success: function(list) { response.success(list); }, error: function(error2) { response.error({'resp': error2.code, 'message': error2.message}); }, }); 

But it didn’t work either.

It starts to bother me.


OUR TIME OF WORK: The workaround that we are trying to do is to collect everything separately and then return to the user together. This is not a good practice, since a small change in the class in the future can ruin the whole function.

Is this a bug in the SDK?

+5
source share
1 answer

(This comment turned into an answer)

Just a thought, because I recently had a problem with CloudCode, which is very similar to yours. What version of the JavaScript SDK are you using? I solved my problem by changing the version to 1.4.2. This is just a shot in the dark in your case, but it might work.

Here is the thread where I described the problem and how to solve it by changing the SDK version.

+1
source

Source: https://habr.com/ru/post/1233444/


All Articles