0

Is there a way to make primary key and foreign key relationship with Parse tables? If yes, how?

I've two tables:

User Table:

uId (primary key/string) | uName (string) | uAge (number) | uGender (string) | uLocation (string)

Employment Table:

eId (unique/string) | eType (number) | eSalary (number) | uId (foreign key/string)

So that, if I'll delete an entry from User table, it'll delete all entries for that particular user in Employment table.

1 Answer 1

3

The objectId created by parse is the unique identifier. There is no concept of a primary key from the point of view of indexing, just unique identification.

A pointer or relationship is the approach you should use to foreign key linking. This is effectively a link to the foreign object objectId.

There is no automatic deletion logic. To accomplish that you would use a before delete cloud trigger to process and cascade the deletion to the linked objects.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.