在使用 Feathers JS 发布数据时,有什么方法可以防止 RethinkDB 自动生成带连字符的 ID?现在,当我通过我的 FeathersJS 将一大块 JSON 数据发布到 RethinkDB 时,Rethink 正在自动创建带有连字符/破折号 (-) 的 ID 字段。有我禁用它的配置吗?或者我需要手动提供 ID 字段?
最佳答案
RethinkDB 使用 UUIDs作为主键,不允许更改该行为。来自 this answer (在 RethinkDB 中请求自动递增字段 ID):
No, RethinkDB doesn't support it. The reason is because of its distribution. It's hard to have an auto increment number on such that environment because you have to check on multiple machines for next incremental value.
In RethinkDB, UUID guarantees the uniqueness, especially in the case of primary key.
关于javascript - 有没有办法防止 RethinkDB 自动生成的 ID 字段中出现连字符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49623093/