本文整理汇总了TypeScript中parse.Parse.Query类的典型用法代码示例。如果您正苦于以下问题:TypeScript Parse.Query类的具体用法?TypeScript Parse.Query怎么用?TypeScript Parse.Query使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Parse.Query类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: saveStates
saveStates() {
let self= this;
var States = Parse.Object.extend("States");
var states= new States;
var query = new Parse.Query("States");
var innerQuery = new Parse.Query(States);
innerQuery.exists(self.state);
query.matchesQuery("Name", innerQuery);
query.find({
success: function(object){
console.log('notexist' + self.state)
var States = Parse.Object.extend('States');
var states = new States();
var data={
Name:self.state
};
states.save(data,{
success: function(user){
console.log('created states')
},
error: function(user, error){
console.log(error)
}
})
} , error : function(){
console.log(' exist')
}
});
}
开发者ID:cybriz,项目名称:ionic-projects,代码行数:29,代码来源:summary.ts
示例2: function
success: function(products) {
var pro = Parse.Object.extend("Products");
var query = new Parse.Query(pro);
query.equalTo("category", products[0]);
query.find({
success: function(products) {
success(products);
}
});
}
开发者ID:valero90,项目名称:Angular2-Parse,代码行数:10,代码来源:ParseManager.ts
示例3: getProductsCategory
getProductsCategory(success: (products) => void)
{
var catClass = Parse.Object.extend("ProductsCategory");
var query = new Parse.Query(catClass);
query.find({
success: function(categories) {
success(categories);
}
});
}
开发者ID:valero90,项目名称:Angular2-Parse,代码行数:10,代码来源:ParseManager.ts
示例4:
success: (query:any) => {
var objectId = query[0].id;
ParseClass = Parse.Object.extend("Users");
var update = new Parse.Query(ParseClass);
update.get(objectId, {
success: (update:any)=> {
update.set("Time", 0);
update.save();
},
error: (object:any, error:any) => {
}
});
},
开发者ID:saulmadi,项目名称:acklen-slackbot,代码行数:13,代码来源:parseDB.ts
示例5: userIsBack
userIsBack(user:any) : any
{
var today = new Date();
var tommorrow = new Date();
today.setHours(0,0,0,0);
tommorrow.setDate(today.getDate()+1);
tommorrow.setHours(0,0,0,0);
var ParseClass = Parse.Object.extend("Users");
var query = new Parse.Query(ParseClass);
query.equalTo("User", user);
query.greaterThan("createdAt", today);
query.lessThan("createdAt", tommorrow);
query.descending("createdAt");
query.find({
success: (query:any) => {
var objectId = query[0].id;
ParseClass = Parse.Object.extend("Users");
var update = new Parse.Query(ParseClass);
update.get(objectId, {
success: (update:any)=> {
update.set("Time", 0);
update.save();
},
error: (object:any, error:any) => {
}
});
},
error: (object:any, error:any) => {
}
});
}
开发者ID:saulmadi,项目名称:acklen-slackbot,代码行数:34,代码来源:parseDB.ts
示例6: getProducts
getProducts(category: String, success:(products)=>void)
{
var cat = Parse.Object.extend("ProductsCategory");
//var pro = Parse.Object.extend("Products");
var innerQuery = new Parse.Query(cat);
innerQuery.equalTo("objectId", category);
//innerQuery.include("products");
//var query = new Parse.Query(pro);
//query.matchesQuery("category", innerQuery);
innerQuery.find({
success: function(products) {
var pro = Parse.Object.extend("Products");
var query = new Parse.Query(pro);
query.equalTo("category", products[0]);
query.find({
success: function(products) {
success(products);
}
});
}
});
}
开发者ID:valero90,项目名称:Angular2-Parse,代码行数:22,代码来源:ParseManager.ts
示例7: checkIsAbscent
checkIsAbscent(messageSender:any, user:any): any{
var today = new Date();
var tommorrow = new Date();
today.setHours(0,0,0,0);
tommorrow.setDate(today.getDate()+1);
tommorrow.setHours(0,0,0,0);
var Class = Parse.Object.extend("Users");
var query = new Parse.Query(Class);
query.equalTo("User", user);
query.greaterThan("createdAt", today);
query.lessThan("createdAt", tommorrow);
query.descending("createdAt");
query.find({
success: (result:any) => {
var format = result[0].attributes.Format;
if(format == 'min')
{
today = new Date();
var abscenceStartTime = result[0].createdAt;
var abscenceEndTime = this.addMinutes(abscenceStartTime,result[0].attributes.Time);
if(today> abscenceStartTime && today<abscenceEndTime)
{
var date = new Date(abscenceEndTime.toString());
messageSender.send( result[0].attributes.User + " is abscent, will be back around " + moment(date).format('h:mm A'));
}
}else if(format == 'hour')
{
today = new Date();
var abscenceStartTime = result[0].createdAt;
var abscenceEndTime = this.addHours(abscenceStartTime,result[0].attributes.Time);
if(today> abscenceStartTime && today<abscenceEndTime)
{
var date = new Date(abscenceEndTime.toString());
messageSender.send(result[0].attributes.User + " is abscent, will be back around " + moment(date).format('h:mm A'));
}
}else if(format == 'day')
{
}
},
error: (error:any) => {
console.log(error.message);
}
});
}
开发者ID:saulmadi,项目名称:acklen-slackbot,代码行数:54,代码来源:parseDB.ts
注:本文中的parse.Parse.Query类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论