AWSAmplify DataStore iOS: Populating relationships

0

Hi, I am trying to implement offline app using Datastore in iOS. I was going through this guide saving-relations In the example if we want to create a Comment and associate to a Post we have to supply the entire Post object. Is there a possibility to pass in just the postID and the comment then gets associated with that Post? I tried this by adding (fields: ["postID"]) but the comments never gets populated in the Post object. Whats the correct way to model this?

Objective is to just pass in the postId for creating and associating a comment to the post and make sure when querying the post, I get the comments field populated.

질문됨 2년 전92회 조회
답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠