本文整理汇总了TypeScript中backendless.Persistence类的典型用法代码示例。如果您正苦于以下问题:TypeScript Persistence类的具体用法?TypeScript Persistence怎么用?TypeScript Persistence使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Persistence类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: getTagByName
getTagByName(name: string): Promise<Tag> {
let query = new Backendless.DataQuery();
query.condition = "name='" + name + "'";
return Backendless.Persistence.of(Tag).find(query)
.then(res=>{
if(!res.data.length) throw new Error('Tag with such name isn\'t existed');
return res;
});
}
开发者ID:schaffe,项目名称:Pathfinder,代码行数:9,代码来源:likeService.ts
示例2: getDisplayTag
getDisplayTag(place:Place, tag: Tag) {
let query = new Backendless.DataQuery();
query.condition = "place.objectId='" + place.objectId + "' and tag.objectId='" + tag.objectId + "'";
return Backendless.Persistence.of(Likes).find(query)
.then(res=>{
let dispTag = new DisplayTag(tag, res.totalObjects);
console.log("getDisplayTag:");
console.log(dispTag);
return dispTag;
});
}
开发者ID:schaffe,项目名称:Pathfinder,代码行数:11,代码来源:likeService.ts
示例3: getLikedTags
getLikedTags(placeID:string) {
let query = new Backendless.DataQuery();
query.condition = "place.objectId='" + placeID + "'";
query.options = { relations: ["tag"] };
return Backendless.Persistence.of(Likes).find(query).
then(res => res.data.map((like) => like.tag))
.then(tags => {
let displayTags = [];
let tagsCount = _.groupBy(tags, "objectId");
for (let key in tagsCount) {
displayTags.push(new DisplayTag(tagsCount[key][0], tagsCount[key].length))
}
return displayTags;
});
}
开发者ID:schaffe,项目名称:Pathfinder,代码行数:15,代码来源:likeService.ts
示例4: Tag
err=>{
let tag = new Tag();
tag.name = tagName;
return Backendless.Persistence.of(Tag).save(tag);}
开发者ID:schaffe,项目名称:Pathfinder,代码行数:4,代码来源:likeService.ts
示例5: Likes
.then(user=>{
let like = new Likes(place, user, tag);
return Backendless.Persistence.of(Likes).save(like);
});
开发者ID:schaffe,项目名称:Pathfinder,代码行数:4,代码来源:likeService.ts
示例6: search
search(term:string) {
var tagStorage = Backendless.Persistence.of(Tag);
var dataQuery = new Backendless.DataQuery();
dataQuery.condition = "name LIKE '%" + term + "%'";
return tagStorage.find( dataQuery );
}
开发者ID:schaffe,项目名称:Pathfinder,代码行数:6,代码来源:searchService.ts
注:本文中的backendless.Persistence类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论