Is it possible to get a record from parse.com without knowing the object?

See the code example below - in this case, the name of the object for the record I am trying to get is known.

My question is: if I do not know the Parse.com object, how to implement the code below?

var Artwork = Parse.Object.extend("Artwork"); var query = new Parse.Query(Artwork); query.get(objectId, { success: function(artwork) { // The object was retrieved successfully. // do something with it }, error: function(object, error) { // The object was not retrieved successfully. // warn the user } }); 
+6
source share
3 answers

Of course, you can use Parse Query to search for objects based on their properties.

0
source

Inquiry. get () is used when you already know the identifier of the Parse object. Otherwise, you can use the query. find () to get objects based on query parameters.

+2
source

In the documentation, it was not clear to me that as soon as you receive the object in the request, you will need to do:

With a query (can return multiple objects):

 artwork[0].get('someField'); 

With "first" or "get":

 artwork.get('someField'); 

You cannot do something like artwork.someField , as I assumed that you

0
source

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


All Articles