Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您不能再在 towerjs 的当前开发分支中设置特定的 id。
你知道有没有办法做到这一点?
我似乎无法做到:
data = id: "123456asdasd" name: "Foo" App.User.create data, (err, resource) => console.log resource.get("id") resource.set "id", data.id resource.save() # doesn't work
我找到了解决方案:
您可以像这样指定一个 ID:
data = id: "123456asd" name: "Foo" record = App.User.build data record.set "_id", data.id record.save => console.log record.get("id")