I have two collections - Categories and Products. Category have array of products. How I can create needed relation for objects? I have Products column with content for one category:
{
"_type":"KinveyRef"
"_id":"574a889c0ee767ef41d9a3d7"
"_collection":"products"
}
How I can create one-to-many relationship?
Artem,
Assuming you have maintained an array of Product ids in Category collection, you can expand the product information, by querying about individual Product ids, in the postfetch hook for Category collection.
Following is the link for implementing collecion hooks:
http://devcenter.kinvey.com/ios/guides/business-logic#collection-hooks
Thanks, Pranav Kinvey Support