Questions tagged [pfrelation]

A class that is used to access all of the children of a many-to-many relationship as it pertains to a specific PFObject. Each instance of PFRelation is associated with a particular parent object and key.

More information available here.

64 questions
1
vote
1 answer

Query Parse Object based on empty relation

I have a parse object that I need to query based on a PFRelation property. I need to query for all objects in which the relation is empty and all objects in which the relation is not empty. What's the best approach for this? I'm using the iOS…
codeetcetera
  • 3,213
  • 4
  • 37
  • 62
1
vote
2 answers

Create a PFObject and PFRelation after PFUser Sign Up

In my structure, I would like to signUp a User and assign a Group to it directly (Many to many relationship model) Below is how I signUp the user. after completion, I have no idea how to relate to the PFObject using PFRelation. Any thoughts please?…
JayVDiyk
  • 4,277
  • 22
  • 70
  • 135
1
vote
1 answer

Why is a PFRelation saved by saving the PFUser object?

so I am having trouble understanding how a PFRelation saves, I have this code: PFUser *user = [PFUser currentUser]; PFRelation *relation = [user relationForKey:@"likes"]; [relation addObject:post]; [user saveInBackground]; Why is it that updating…
Kex
  • 8,023
  • 9
  • 56
  • 129
1
vote
1 answer

Parse.com SDK: What is the purpose of PFRelation?

In the parse.com framework you can associate an object with another object with a PFRelation. I was reading the Parse docs on this but I'm not finding a key point in the documentation. What exactly is the advantage of using a PFRelation? Like, does…
Brandon A
  • 8,153
  • 3
  • 42
  • 77
1
vote
1 answer

Handle one to many relation in Parse in iOS

I have this scenario: One post could have many comments. So I create a Post class and a Comment class in Parse.com. Here are the definitions or the class and their data: One post: The post have two comments: I want to retrieve the post with the…
Bagusflyer
  • 12,675
  • 21
  • 96
  • 179
1
vote
1 answer

Parse - how to add comments to an image?

I'm trying to create an iOS application where users post and image, and then someone can comment on the image. So far I've set up the a message class which contains (among other things) the image file. I want to be able to add comments to the image,…
1
vote
2 answers

Understanding and using Parse many to many relations

I have 2 tables in Parse like so: Users: (PFUsers table with all Parse data) belongsToGroups (A Parse Relation to Groups which is many to many) Groups: groupId name groupMembers (A Parse Relation to Users which is also many to many) I have the…
cdub
  • 24,555
  • 57
  • 174
  • 303
1
vote
1 answer

Adding a user to PFRelation using Parse Cloud Code

I am using Parse.com with my iPhone app. I ran into a problem earlier where I was trying to add the currently logged in user to another user's PFRelation key/column called "friendsRelation" which is basically the friends list. The only problem, is…
user3344977
  • 3,584
  • 4
  • 32
  • 88
1
vote
3 answers

Trying to query a PFRelation for a specific user in Parse

I'm trying to query a PFRelation of the current user of the app to load a table view showing all of the users friends. Each user is saved under a class called "User" when they first use the app and once they add a friend that friend is added to the…
user1681673
  • 368
  • 1
  • 6
  • 28
0
votes
1 answer

Parse/SwiftUI - PFObject values may not have class: PFRelation

Everytime I try to decode the data, the application crashes with: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'PFObject values may not have class: PFRelation' This is my model: class ParseUserPosts: PFObject { …
0
votes
1 answer

Getting PFObject from Parse Relation

I have a PFRelation between Users and Offers that the User saved. Each Offer has a pointer reference to a Product PFObject. Even though I am getting the Offers saved for the particular User, the Product PFObject inside the Offer PFObject is not…
Joey
  • 1
  • 1
0
votes
1 answer

With Parse cloud code, query a users friends using PFRelation

In Parse cloud code, I need to query a list of all users in relation (pfrelation) with a given user. The Parse cloud code reference isn't very extensive. Here is what I have... Parse.Cloud.define("FindFriendsWithRelation", function(request,…
adrian1kat
  • 138
  • 16
0
votes
0 answers

Parse: Updating relation on user in Local Datastore

I am developing an app where I have a user who has some favourite objects. These favourites are currently modelled by a PFRelation on the user object. The app needs to function in offline scenarios, so I'm using the Parse local datastore. I'm…
Darren Black
  • 1,030
  • 1
  • 9
  • 28
0
votes
1 answer

Parse to Heroku migration (MongoLab): PFRelation issue

I succeeded to migrate parse to parse-server with mongolab. Now everything works as expected, except when I'm logging with PFUser with MongoLab, my PFRelation object is always null. In my AppDelegate, when I run this code (official Parse): [Parse…
Vjardel
  • 1,065
  • 1
  • 13
  • 28
0
votes
1 answer

Parse PFRelation complex search

I'm building an iOS app with Parse that has a few complex queries and running into some trouble with PFRelation. It's a social network website where people submit articles. You can follow other users and see the articles they submitted. You can…
Buyin Brian
  • 2,781
  • 2
  • 28
  • 48