Tag: keystonejs

小parsingID迁移到正常的MongoDB的ObjectIDs

我正在使用Parse Dashboard进行iOS应用程序的用户pipe理。同时,我正在使用使用MongoDB数据库的外部API。 目前我面临的问题是从Parse Dashboard创build的用户使用的是小ID而不是MongoDB的ObjectID,而其他没有被parsing的资源是由普通ObjectID生成的。 例如。 用户对象: { _id:"qVnyrGynJE", user_name:"Aditya Raval" } 文档对象: { _id:"507f191e810c19729de860ea", doc_name:"Marksheet", user:"qVnyrGynJE" } 任务对象: { _id:"507f191e810c19729de860ea", task_name:"Marksheet", user:"qVnyrGynJE" } 我也使用Keystone.js作为后端pipe理仪表板。所以基本上是由于KeyStone.js内部的这种ID混合关系被打破,Keystone.js崩溃。 所以我想将所有现有的小ID迁移到正常的MongoDB ObjectID,而不必通过修复Keystone.js来打破人际关系或其他漫游

如何在KeystoneJS中创build唯一的键

我正在使用KeystoneJS构build的网站,允许用户发布单词并从其他用户那里获取build议的同义词。 单词是作为短语或句子的一部分提交的,例如“猫已经(危险地)接近敲开玻璃杯”。 我的句子模型看起来像这样: Sentence.add({ sentence: { type: Types.Text, required: true, initial: "New Sentence", index: true }, word: { type: Types.Relationship, ref: 'Word', required: true, index: true, unique: true, initial: true }, submitter: { type: Types.Relationship, ref: 'User', required: true, index: true, unique: true, initial: true }, source: { type: Types.Text }, createdAt: { type: Date, […]