本文整理汇总了TypeScript中avoscloud-sdk.Object类的典型用法代码示例。如果您正苦于以下问题:TypeScript Object类的具体用法?TypeScript Object怎么用?TypeScript Object使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Object类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: test_query
function test_query() {
var TestObject = AV.Object.extend('TestObject')
var todoObject = new TestObject();
var query = new AV.Query(TestObject);
query.equalTo("testString", "leancloud");
query.notEqualTo("testString", "aws");
query.greaterThan("testInteger", 150);
query.limit(10);
query.skip(10);
// Sorts the results in ascending order by the score field
query.ascending("testString");
// Sorts the results in descending order by the score field
query.descending("testString");
// Restricts to wins < 50
query.lessThan("testInteger", 50);
// Restricts to wins <= 50
query.lessThanOrEqualTo("testInteger", 50);
// Restricts to wins > 50
query.greaterThan("testInteger", 50);
// Restricts to wins >= 50
query.greaterThanOrEqualTo("testInteger", 50);
// Finds scores from any of Jonathan, Dario, or Shawn
query.containedIn("testString",
["leancloud", "aws", "azure"]);
// Finds scores from anyone who is neither Jonathan, Dario, nor Shawn
query.notContainedIn("testString",
["leancloud", "aws", "azure"]);
// Finds objects that have the score set
query.exists("testInteger");
// Finds objects that don't have the score set
query.doesNotExist("testInteger");
query.select("testInteger", "leancloud");
// Find objects where the array in arrayKey contains 2.
query.equalTo("arrayKey", 2);
// Find objects where the array in arrayKey contains all of the elements 2, 3, and 4.
query.containsAll("arrayKey", [2, 3, 4]);
query.startsWith("testString", "l");
}
示例2: avobject_Test
import * as AV from 'avoscloud-sdk'
// 创建一个新的 TestObject 对象
AV.initialize('uay57kigwe0b6f5n0e1d4z4xhydsml3dor24bzwvzr57wdap','kfgz7jjfsk55r5a8a3y4ttd3je1ko11bkibcikonk32oozww');
var TestObject = AV.Object.extend('TestObject');
function avobject_Test() {
var testObject = new TestObject();
testObject.set("testBoolean", false);
testObject.set("testInteger", 178);
testObject.set("testString", "leancloud");
testObject.set("testDate", new Date());
testObject.set("testArray", ["leancloud","is","great"]);
testObject.set("testDictionary", {key:"value"});
testObject.increment("testInteger");
testObject.addUnique("testArray", "service");
testObject.save();
}
function test_query() {
var TestObject = AV.Object.extend('TestObject')
var todoObject = new TestObject();
var query = new AV.Query(TestObject);