code: async function list(ctx) {
    let { Model } = ctx.state;
    let code = Model.api.list;
    if (code > _alaska.PUBLIC && !ctx.user) {
      //未登录,需要认证
      ctx.status = 401;
      return;
    }
    ctx.status = 200;
  
    const scope = ctx.state.scope || ctx.query._scope || 'list';
  
    let filters = await Model.createFiltersByContext(ctx);
  
    if (code === _alaska.OWNER) {
      //只允许用户列出自己的资源
      let { userField } = Model.userField;
      // $Flow 这里可以确认ctx.user存在
      filters[userField] = ctx.user._id;
    }
  
    let results = await Model.listByContext(ctx, { scope, filters });
  
    ctx.state.listResults = results;
  
    ctx.body = results.map(doc => doc.data(scope));
  }
docs: 所有数据列表接口