-1

I'm using parse.com to develop my app. I want to add tagging features for uploaded images. I know I have to use many to many relation, because (one tag) can have many images, and (one image) can have many tags.

I read the documentation where they use Parse relation to set this type of relation, they create 2 objects and then add one object to another. But in my case they are 2 fields in same class, and I don't know is it possible to create many-to-many relation between 2 columns.

any help would be greatly appreciated

Ran
  • 145
  • 2
  • 11
  • I just did some digging through parse documentation for Android. In this link: https://parse.com/docs/android/guide#objects-relational-data they talk about how to model many to many relationships. They describe in similarly to what I said but they have a specific object for it. Read about it and let me know what you think! – Runner5 Jul 24 '15 at 14:42

1 Answers1

0

Would it be reasonable to create an Image and Tag object, separate from this main object, then have the image object contain all the relevant tag references then the Tag object contains all the necessary Image references? Then put these objects into the Image and Tag categories of the main object. This should cover the relations.

Runner5
  • 104
  • 1
  • 8
  • Can you simplify your answer more please .. I didn't get your answer at all . – Ran Jul 23 '15 at 16:44
  • Suppose you have 3 Parse objects. Your main one, an image one, and a tag one. The main has Image and Tag categories for the Image and Tag objects discussed above. In the Image object, put the ID of that one image and then a list of tags referencing to that one image and put this object in the image category of your main object. In the Tag object, put the ID of that one tag and then the list of images the one tag references and put this in Tag category in the main object. I am not 100% sure about this working but it is a good starting point. – Runner5 Jul 23 '15 at 16:58
  • I'm not getting it where you say .. the word "category" .. does that exists in parse.com ? I'm a newbie :( – Ran Jul 23 '15 at 17:03
  • Sorry for my poor nomenclature. When I say category I mean the columns in the object. That was my bad. – Runner5 Jul 23 '15 at 17:07
  • So you can make objects in parse and then put those Parse objects inside another parse object. To me it sounds like you have one main parse object. So my suggestion is to make two more parse objects, Image and Tag, and place those inside the columns in the main parse object. Then handle all the connections in those two objects but they are still a part of the main object. Does that make sense? – Runner5 Jul 24 '15 at 13:01
  • Can I make tags in the main of type pointer to Tags class ? .. now I'm stuck here .. – Ran Jul 24 '15 at 13:24
  • 1
    And yes you can make pointers to the other parse objects from your main parse object. So you have a pointer to the tag object from that main object. – Runner5 Jul 24 '15 at 16:00