lrf 2 年之前
父節點
當前提交
0c8c92ab0b
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      lib/service/crud-service.js

+ 1 - 1
lib/service/crud-service.js

@@ -199,7 +199,7 @@ class CrudService extends NafService {
           const arr = ref.split('.');
           const conn = this.app.mongooseDB.get(getHead(arr));
           const refModel = last(arr);
-          const schema = this.ctx.model[refModel].schema;
+          const schema = get(this.ctx.model, `${refModel}.schema`);
           const model = conn.model(refModel, schema);
           const p = { path: key, model };
           populate.push(p);