-
-
Notifications
You must be signed in to change notification settings - Fork 206
support Parse Relation #169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@WahdanZ queries and create with Many to many: No |
not queries but I'm talking about creating a relation between object // let’s say we have a few objects representing Author objects
ParseObject authorOne =
ParseObject authorTwo =
ParseObject authorThree =
// now we create a book object
ParseObject book = new ParseObject("Book");
// now let’s associate the authors with the book
// remember, we created a "authors" relation on Book
ParseRelation<ParseObject> relation = book.getRelation("authors");
relation.add(authorOne);
relation.add(authorTwo);
relation.add(authorThree);
// now save the book object
book.saveInBackground(); thre is a ParseRelation object. ParseUser user = ParseUser.getCurrentUser();
ParseRelation<ParseObject> relation = user.getRelation("likes");
relation.add(post);
user.saveInBackground(); http://docs.parseplatform.org/android/guide/#using-parse-relations |
three is different between pointer and relation Basically you have 4 options with Parse: Pointer - single reference to another class (1 to 0..1) |
like facebook post the author will be a pointer for the post owner, but likes will be a relation object of the users who like this post |
See example below: Was this? final ParseUser user = await ParseUser.currentUser() as ParseUser;
var parseObject = ParseObject("TestAPI");
parseObject.set<ParseUser>("user", user);
parseObject.set<List<ParseUser>>("users", [user, user]);
ParseResponse apiResponse = await parseObject.save(); Users field content: [
{
"__type": "Pointer",
"className": "_User",
"objectId": "0C6ptX39c8"
},
{
"__type": "Pointer",
"className": "_User",
"objectId": "0C6ptX39c8"
}
] |
it's different between pointer and relation, If the array of pointer likely to be more than 100 (recommended limit by Parse), it is better you go with relations. Because arrays don't scale to large relationships. https://www.youtube.com/watch?v=x70G_LPlW60 see the implementation of ParseRelation |
I understood. Today lib does not support this. |
I also encountered the same problem when trying this plugin. I have to modify parse class structure currently. |
@WahdanZ I had add |
@yulingtianxia it's reversed back to 1.0.21. there's no 1.0.22 release yet. |
@zenz https://github.com/phillwiggins/flutter_parse_sdk/blob/release/1.0.22/README.md |
I gave it a try. and it seems broken something. Since 1.0.22 was not released yet, so I use git url to fetch it:
Here's my sample: |
@phillwiggins Hi, this issue(#190 (comment)) can also reappear in his sample. |
I had figure out why this issue #190 happened. |
There's not been much movement on this recently. Are we safe to close? |
support relation object one to many and many to many
https://docs.parseplatform.org/rest/guide/#relations
http://docs.parseplatform.org/android/guide/#relational-data
The text was updated successfully, but these errors were encountered: