0
いくつかのmysql関数で使用できるグローバル関数を使用しようとしましたが、問題はjsが ".then"が未定義であると言っています。 、これは構文エラーだけですか?Node.jsは未定義のプロパティ 'then'を読み取ることができません
static connectWidthCortex(){
xdevapi.getSession({
host: 'localhost',
port: 33060,
dbUser: 'admin',
dbPassword: 'xxxx'
}).then((session)=> {
return session.getSchema("cortex");
});
};
static createCollection(collname){
this.connectWidthCortex().then((db)=> {
console.log("Cortex connected")
return db.createCollection(collname);
}).catch((err)=> {
console.log("connection failed")
});
}
助けのためのThxを:)
私は '約束ではありません)' connectWidthCortex(の戻り値を推測しています。確認できますか? – GPX