Can a Parse object be fetched with object.fetch
and at the same time include its object references as in query.include
?
Here is the query example:
let query = new Parse.Query("MyCollection");
query.include("MyObjectReference");
return query.find();
How to do it with a fetch command?
It is possible to fetch one or multiple objects with include:
fetchWithInclude
https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Object.html#fetchWithIncludefetchAllWithInclude
https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Object.html#.fetchAllWithInclude)It's not possible as the docs say:
By default, when fetching an object, related Parse.Objects are not fetched. These objects’ values cannot be retrieved until they have been fetched like so:
var post = fetchedComment.get("parent"); post.fetch({ success: function(post) { var title = post.get("title"); } });