Created
August 28, 2014 09:08
-
-
Save YutaWatanabe/0e248e77dd1bf84975f9 to your computer and use it in GitHub Desktop.
data read method of azure mobile services
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// テーブルのすべての項目の読出します | |
itemTable.read() | |
.then(function(items){ | |
// 配列で項目が返ってきます | |
$each(items, function(i, e){ | |
// 項目 i に対する処理 | |
}); | |
}); | |
// 条件を指定して項目を読み出します | |
itemTable.where({text: "Sample Item"}).read() | |
.then(function(items){ | |
//配列で該当する項目が返ってきます | |
console.log(items); | |
}); | |
// 取得する項目の数を指定してみます | |
itemTable.take(5).read() | |
.then(function(items){ | |
//上位5つの項目を取得します | |
console.log(items); | |
}); | |
// where と組み合わせたり skip() 途中から読み込みます | |
itemTable.where({text: "Sample Item"}).skip(5).take(5).read() | |
.then(function(items){ | |
//上位から5つ飛ばして、その次から5つの項目を取得します | |
console.log(items); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment