2016-07-18 8 views
0

Apache Cordovaアプリケーション(Android)、angularjsベース、およびWindowsAzure MobileServiceClientライブラリを使用してEasy Tableのデータを取得していますSQLデータベースに格納します。Azure MobileServiceClient(Node.js)から50件以上のレコードを取得できません

これは機能します。 50以上のレコードを取得するまでは だから私はテーブルの読み込みに.take(100)を追加しました。まだ50レコード.. 私は、おそらくテイク機能が全く働かないと思ったので、金額を5に変更しました。したがって、テイク関数はいくらか働いていますが、50レコード以上はありません。

node.jsバックエンドなので、どのようにページサイズを増やすのですか?

は、ここに私の現在のコードです:Node.jsの中のモバイルアプリのテーブル操作のソースコードよる

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); 
} 

答えて

1

read operationが最終的に制限することができtake()機能が含まれていqueryjsオブジェクトは、あるcontext.queryを受け取ります指定された番号に返された項目の数。

さらに、take()機能はモバイルアプリサーバーsdkに含まれているため、クライアントの終了コードでは機能しません。

Easy Tablesスクリプト(E.G.)でいくつかの変更を行うことができます。

table.read(function (context) { 
    context.query.take(100); 
    return context.execute(); 
}); 
+0

@ gary-liu-msftありがとう!それはトリックでした! :) –

関連する問題