How to create cognito dataset ? can't find example or explanation anywhere

0

Greetings, I'm trying to create a new dataset for an existing identity in cognito, using php sdk 3, but I can't seem to find any actual explanation or example of how to do this. Not even the API reference seems to have a method to create a new dataset...

In some places it is said that cognito will create a dataset if it doesn't exist... but there is no actual explanation of which method, event or action will trigger this.

I've tried describeDataset and listDatasets but the dataset is not created if it doesn't exist... updateRecords does work, but only if the dataset exists, because I can't get a sync token if there is no dataset in the first place.

I would really appreciate any help or ideas to create a dataset using php, even if it's using the raw API or an AWS CLI command.
Thank you.

pcriado
質問済み 5年前296ビュー
1回答
0

In case anyone wonders, I figured it out after much trial and error. In both the php and nodejs sdks you have to call listRecords() with the new dataset name, retrieve the syncToken from that response, and then call updateRecords() with the new dataset name and the syncToken from the previous call.

This tiny bit of information appears to be missing from all the docs available... extremely unfortunate IMHO...

pcriado
回答済み 5年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ