You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Example : I have a products class which has a pointer to Events class through the "event" field. I want to extract all the matched items from Products that belongs to the same Event.
For example, for an event of objectId "QHIXTBECcv" the following item from Products class should be returned :
{
"objectId": "LozokqgJQz",
"price": 9,
"name": "Entree + Conso",
"event": {
"__type": "Pointer",
"className": "Event",
"objectId": "QHIXTBECcv"
}
//For showing the matched products
for (let i = 0; i < results.length; i++) {
var object = results[i];
alert(object.get('event') + ' - ' + ' Price ' + object.get('price'));
}
Expected Results
I want to be able to supply whatever event objectId to const needle = {"__type": "Pointer", "className": "Event", "objectId": "QHIXTBECcv"};
instead of hardcoding it to "QHIXTBECcv"
I want some means of specifying a variable name.
something like : const needle = {"__type": "Pointer", "className": "Event", "objectId": varobjectId};
but it's not working!
What is the correct syntax for doing that? or is there some other way of doing this whole thing?
The text was updated successfully, but these errors were encountered:
// Suppose in this game app, we want to make sure that every Game object is associated with a Parse User. We can implement this like so:
var game = new Parse.Object("Game");
game.set("createdBy", Parse.User.current());
// We can obtain all of the Game objects created by a Parse User with a query:
var query = new Parse.Query("Game");
query.equalTo("createdBy", Parse.User.current());
// You can also do relational queries by objectId:
var post = new Post();
post.id = "1zEcyElZ80";
query.equalTo("post", post);
Issue Description
I have one question about querying objects
Example : I have a products class which has a pointer to Events class through the "event" field. I want to extract all the matched items from Products that belongs to the same Event.
Products class :
"results": [
{
"objectId": "LozokqgJQz",
"price": 9,
"name": "Entree + Conso",
"event": {
"__type": "Pointer",
"className": "Event",
"objectId": "QHIXTBECcv"
}
},
{
"objectId": "CDzofqgJQz",
"price": 10,
"name": "Entree + Conso",
"event": {
"__type": "Pointer",
"className": "Event",
"objectId": "FHIXTZZCcv"
}
},
{
"objectId": "DXzosqgJQz",
"price": 10,
"name": "Entree + Conso",
"event": {
"__type": "Pointer",
"className": "Event",
"objectId": "FHIXTZZCcv"
}
}
]
For example, for an event of objectId "QHIXTBECcv" the following item from Products class should be returned :
{
"objectId": "LozokqgJQz",
"price": 9,
"name": "Entree + Conso",
"event": {
"__type": "Pointer",
"className": "Event",
"objectId": "QHIXTBECcv"
}
Steps to reproduce
What I have done already :
//For showing the matched products
for (let i = 0; i < results.length; i++) {
var object = results[i];
alert(object.get('event') + ' - ' + ' Price ' + object.get('price'));
}
Expected Results
I want to be able to supply whatever event objectId to
const needle = {"__type": "Pointer", "className": "Event", "objectId": "QHIXTBECcv"};
instead of hardcoding it to "QHIXTBECcv"
I want some means of specifying a variable name.
something like :
const needle = {"__type": "Pointer", "className": "Event", "objectId": varobjectId};
but it's not working!
What is the correct syntax for doing that? or is there some other way of doing this whole thing?
The text was updated successfully, but these errors were encountered: