无法添加第15集到Sails Mongo



每当我尝试添加我的第15个集合时,我都会失败。

errorType': 'Error', 'errorMessage': 'Callback已被调用。', 'trace':['错误:回调已被调用。"、"at eval (webpack://mnUvr-api/./node_modules/async/dist/async.js?:843:36)', 'at eval (webpack://mnUvr-api/./node_modules/waterline/lib/waterline/utils/system/validate-datastore-connectivity.js?:31:14)', 'at eval (webpack://mnUvr-api/./node_modules/machine/lib/private/help-build-machine.js?:952:35)', 'at Function.handlerCbs.error (webpack://mnUvr-api/./node_modules/machine/lib/private/help-build-machine.js?:742:26)', '在谈判。重试(webpack://mnUvr-api/./node_modules/machine/lib/private/help-build-machine.js?:1088:49)', '@ parley (webpack://mnUvr-api/./node_modules/parley/lib/parley.js?:140:5)', 'at Object.runFn [as getConnection] (webpack://mnUvr-api/./node_modules/machine/lib/private/help-build-machine.js?:461:23)', 'at validateDatastoreConnectivity (webpack://mnUvr-api/./node_modules/waterline/lib/waterline/utils/system/validate-datastore-connectivity.js?:27:25)', 'at eval (webpack://mnUvr-api/./node_modules/waterline/lib/waterline.js?:722:18)', '在对象。success (webpack://mnUvr-api/./node_modules/sails-mongo/lib/index.js?:356:16)', 'at eval (webpack://mnUvr-api/./node_modules/machine/lib/private/help-build-machine.js?:1517:30)', 'at procedtofinalafterexeclc (webpack://mnUvr-api/./node_modules/parley/lib/private/Deferred.js?: 155:14)', 'at procedtointerceptsandchecks (webpack://mnUvr-api/./node_modules/parley/lib/private/Deferred.js?:913:12)', 'at procedtoafterexecspinlocks (webpack://mnUvr-api/./node_modules/parley/lib/private/Deferred.js?:845:10)', 'at eval (webpack://mnUvr-api/./node_modules/parley/lib/private/Deferred.js?:303:7)', 'at eval (webpack://mnUvr-api/./node_modules/machine/lib/private/help-build-machine.js?:954:24)'

这是发生在我的第15个收藏,我还没有决定创建一个空白项目,看看它是否以这种方式复制。

export const connectToDatabase = (): Promise<void> => {
if (orm) {
return Promise.resolve();
}
return new Promise((resolve, reject) => {
Waterline.start(config, (err: unknown, _orm: Waterline.Waterline) => {
if (err) {
console.error("Could not start up the ORM:n", err);
return reject(err);
}
orm = _orm as Waterline;
collections = {
Syllabus: getModel("syllabus"),
Clazz: getModel("clazz"),
Move: getModel("move"),
User: getModel<UserModel>("user"),
Family: getModel("family"),
Video: getModel("video"),
ClazzLevel: getModel<ClazzModel>("clazzlevel"),
ClazzMembership: getModel("clazzmembership"),
syllabusOwnership: getModel("syllabusownership"),
series: getModel("series"),
SchoolOwnership: getModel("schoolownership"),
School: getModel("school"),
Product: getModel("product"),
StudentProgress: getModel("studentprogress"),
seriesMembership: getModel("seriesMembership"),
};
resolve();
});
});
};

我有一个非常香草连接到数据库,使用sailsmongo 2.0。我已经可以使用14个集合,没有任何问题,但我去添加另一个集合使用,突然我得到这个错误,我不知道为什么。

我不相信模型本身有问题,因为我已经剥离了所有的属性,使它尽可能无聊,没有语法错误,我仍然得到这个错误。

对任何未来的人,这个问题是与模型的名字有一个大写字母。

seriesMembership: getModel("seriesMembership"),

失败,而以下操作成功:

seriesMembership: getModel("seriesmembership"),

相关内容

  • 没有找到相关文章

最新更新