Backendless Support
 
Answered

How do you create a relationship between a user and the objects they have added?

I am building a gas tracking application, and I have a vehicle object which contains multiple mpg objects, and I want to make it so that every user can have their own vehicles with their own gas mileage data. What is the best way to approach this being that a user can have multiple vehicles and the vehicles can have multiple mpgs? I have attached my data models as they are currently. Thank you for any help.

Leave a Comment

Comments (5)

photo
1

Thank you very much for your response, The one issue that I am having is when trying to use the addRelation functionality I get this error:

  1. Value of type 'IDataStore' has no member 'addRelation'

photo
1

Please make sure you are using version 4 of the SDK. Do you develop with Android or iOS?

photo
1

I develop with iOS and hadn't updated to version 4, thank you!

photo
1

The easiest way for setting up a project for 4.x is described in the quick start guide:

https://backendless.com/docs/ios/doc.html#quick_start_guide