当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Persistence.of方法代码示例

本文整理汇总了TypeScript中backendless.Persistence.of方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Persistence.of方法的具体用法?TypeScript Persistence.of怎么用?TypeScript Persistence.of使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在backendless.Persistence的用法示例。


在下文中一共展示了Persistence.of方法的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.of方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。