H
H
hbrmdc2015-06-12 14:54:59
Parse Server
hbrmdc, 2015-06-12 14:54:59

How to get Parse.Query?

Actually, I want to get Parse.Query without filtering, as is, and then add to the existing array. There is a connection to parse, there is access. When outputting array, keys are assigned from objectId.
Option 1:

var _newEstateData = [
    {objectId: "11", name: 'first object'},
    {objectId: "12", name: 'second object'},
  ];

function getInitialNewEstateQuery() { 
  return {
    initialNewEstateQuery: (new Parse.Query('newEstateData')).ascending('createdAt')
  };
};

function _getNewEstateData(){
  _newEstateData.push(initialNewEstateQuery);
  return _newEstateData
}

error in console:
Uncaught ReferenceError: initialNewEstateQuery is not defined

Option 2:
var _newEstateData = [
    {objectId: "11", name: 'first object'},
    {objectId: "12", name: 'second object'},
  ];

var initialNewEstateQuery = new Parse.Query('newEstateData');

function _getNewEstateData(){
  console.log("_getNewEstate done");
  _newEstateData.push(initialNewEstateQuery);
  return _newEstateData
}

in this case the existing array is rendered and there is simply no response from Parse.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pallid, 2015-06-17
@Pallid

Any Parse.Query will return instances of the new class for any Parse.Object with the same class name.

Parse.com
But first you need to specify the class to which the call is made
var Team = Parse.Object.extend("Team");
var teamQuery = new Parse.Query(Team);

Similar questions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question