2016-12-26 106 views
0

我创建了一个默认的sails.js安装,其中包含一个简单的mysql数据库的所有默认选项。目前,我有一张有91条记录的表格。为什么sails.js默认限制响应?

我有一个离子前端加载该表中的列表,但它显示30条记录。

我用邮差来打sails.js网址(http://localhost:1337/list),那就是显示30条记录返回)。

虽然这是一个重复的努力,我直接在浏览器中打开url(http://localhost:1337/list),它仍然返回30条记录。

有没有sails.js会返回多少个记录的默认值?

如果是这样,我该如何删除此默认值,以便sails.js将返回所有结果而不是子集?我不想分页,我想要完整的列表。

PS我检查了我创建的sails.js模型来验证我没有任何时髦的限制东西,它是超级准系数。

我没有自定义代码,整个sails.js安装是默认减去db连接,骨架控制器和模型。

这里是我的模型:

module.exports = { 
identity: 'List', 

attributes: { 
    id: { 
     type: 'integer', 
     primaryKey: true 
    }, 
    name: { 
     type: 'string', 
     unique: true, 
     required: true 
    }, 
    user: { 
     type: 'integer' 
    } 
    } 
}; 

回答

2

您正在使用的查找行动蓝图。 往里走的config/blueprints.js文件,并检查所有评论...

在那里,你会发现:

/**************************************************************************** 
    *                   * 
    * The default number of records to show in the response from a "find"  * 
    * action. Doubles as the default size of populated arrays if populate is * 
    * true.                  * 
    *                   * 
    ****************************************************************************/ 
    // defaultLimit: 30 

改变它作为你喜欢。

+0

哇..我不能相信我错过了。谢谢! – iolympian