【发布时间】:2016-07-18 16:09:13
【问题描述】:
所以我正在构建一个基于 angularjs 的 Apache Cordova 应用程序 (Android),并使用 WindowsAzure MobileServiceClient 库从我在 SQL 数据库中创建的 Easy Table 中检索数据。
这行得通!直到我想检索超过 50 条记录。 所以我将 .take(100) 添加到我的表格读取中。还有50条记录.. 然后我想,可能take函数根本不起作用,所以我将数量改为5,我只得到了5条记录。所以 take 函数有点工作,但不超过 50 条记录。
既然是node.js后端,如何增加pagesize?
这是我当前的代码:
msc.tables.pokemonType = null;
msc.tables.pokemon = null;
msc.init = function () {
console.log('MobileServiceClient initializing...');
var mobileServiceClient = new WindowsAzure.MobileServiceClient("https://blablablabla");
msc.tables.pokemonType = mobileServiceClient.getTable('PokemonType');
msc.tables.pokemon = mobileServiceClient.getTable('Pokemon');
console.log('MobileServiceClient initialized!');
}
msc.getAllPokemonTypes = function() {
console.log('getAllPokemonTypes - called');
return msc.tables.pokemonType.read().then(function (pokemonTypes) {
console.log('getAllPokemonTypes - done');
return pokemonTypes;
}, msc.handleError);
}
msc.getAllPokemons = function () {
console.log('getAllPokemons - called');
return msc.tables.pokemon.take(100).read().then(function (pokemons) {
console.log('getAllPokemons - done');
return pokemons;
}, msc.handleError);
}
【问题讨论】:
标签: angularjs node.js apache cordova azure