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 年前280 查看次数
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 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则