DynammoDB 中是否有将自动递增的 ID 作为主键存储在表中的选项?我还需要将服务器时间作为创建于"字段(例如,用户创建于)存储在表中.但我找不到任何方法从 DynamoDB 或任何其他 AWS 服务获取服务器时间.
Is there an option in DynammoDB to store auto incremented ID as primary key in tables? I also need to store the server time in tables as the "created at" fields (eg., user create at). But I don't find any way to get server time from DynamoDB or any other AWS services.
你们能帮帮我吗,
谢谢.
其实DynamoDB的功能很少,而这正是它的主要优势.简单.
Actually, there are very few features in DynamoDB and this is precisely its main strength. Simplicity.
对于日期"问题,应该很容易在客户端生成.我可以建议您使用 ISO 8601 日期格式吗?它对程序员和计算机都很友好.
For the "date" problem, it should be easy to generate it on the client side. May I suggest you to use the ISO 8601 date format ? It's both programmer and computer friendly.
在大多数情况下,有一种比使用自动 ID 更好的方法.这通常是 SQL 或 MongoDB 世界中的一个坏习惯.例如,电子邮件或登录信息将为用户提供完美的 ID.但我知道在某些特定情况下 ID 可能有用.
Most of the time, there is a better way than using automatic IDs for Items. This is often a bad habit taken from the SQL or MongoDB world. For instance, an e-mail or a login will make a perfect ID for a user. But I know there are specific cases where IDs might be useful.
在这些情况下,您需要构建自己的系统.在这个 SO answer 和 这篇文章来自 DynamoDB-Mapper 文档,我解释了怎么做它.希望对你有帮助
In these cases, you need to build your own system. In this SO answer and this article from DynamoDB-Mapper documentation, I explain how to do it. I hope it helps
这篇关于DynamoDB 自动递增 ID &服务器时间(iOS SDK)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!