thinkjs / thinkjs

Use full ES2015+ features to develop Node.js applications, Support TypeScript.
https://thinkjs.org/
MIT License
5.31k stars 616 forks source link

thinkjs Mongo文档笔误 #1246

Closed l0ca1 closed 6 years ago

l0ca1 commented 6 years ago

DESC

Mongo部分代码有笔误

code

文档中:

module.exports = class extends think.Mongo {
  async getList() {
    // 如果含有子目录,那么这里带上子目录,如: this.mongo('front/article')
    const article = this.mongo('article');
    const data = await article.select();
    ...
  }
}

应该为:

module.exports = class extends think.Mongo {
  async getList() {
    // 如果含有子目录,那么这里带上子目录,如: this.model('front/article')
    const article = this.model('article');
    const data = await article.select();
    ...
  }
}

相应的在think.Mongo对象中调用部分代码应该为 this.model("")

l0ca1 commented 6 years ago

对不住 另一个问题已经更新了this.mongo方法不存在的bug #1240