2016-12-26 47 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