gpt4 book ai didi

backbone.js - Backbone 模型 ID 是否需要是数字?

转载 作者:行者123 更新时间:2023-12-04 17:10:12 24 4
gpt4 key购买 nike

正如问题所问,模型的 id 是否有必要有一个数字(大概是整数)值?或者是否可以接受任何唯一标识符?例如,我可以使用 GUID 字符串吗?

最佳答案

根据 docs 可以是任意字符串:

ID

A special property of models, the id is an arbitrary string (integerid or UUID). If you set the id in the attributes hash, it will becopied onto the model as a direct property. Models can be retrieved byid from collections, and the id is used to generate model URLs bydefault.

关于backbone.js - Backbone 模型 ID 是否需要是数字?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19305139/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com