当前位置: 首页 > news >正文

做任务可以给钱的网站网站开发规划书

做任务可以给钱的网站,网站开发规划书,wordpress site-name,网站开发毕设开题报告dynamodb java在上一篇文章中#xff0c;我们有机会发布了一些基本的DynamoDB查询操作。 但是#xff0c;除了基本操作之外#xff0c;DynamoDB api还为我们提供了一些额外的功能。 投影是具有类似选择功能的功能。 您选择应从DynamoDB项中提取哪些属性。 请记住#xf… dynamodb java 在上一篇文章中我们有机会发布了一些基本的DynamoDB查询操作。 但是除了基本操作之外DynamoDB api还为我们提供了一些额外的功能。 投影是具有类似选择功能的功能。 您选择应从DynamoDB项中提取哪些属性。 请记住使用投影不会对您的查询帐单产生任何影响。 public MapString,AttributeValue getRegisterDate(String email) {MapString,String expressionAttributesNames new HashMap();expressionAttributesNames.put(#email,email);MapString,AttributeValue expressionAttributeValues new HashMap();expressionAttributeValues.put(:emailValue,new AttributeValue().withS(email));QueryRequest queryRequest new QueryRequest().withTableName(TABLE_NAME).withKeyConditionExpression(#email :emailValue).withExpressionAttributeNames(expressionAttributesNames).withExpressionAttributeValues(expressionAttributeValues).withProjectionExpression(registerDate);QueryResult queryResult amazonDynamoDB.query(queryRequest);ListMapString,AttributeValue attributeValues queryResult.getItems();if(attributeValues.size()0) {return attributeValues.get(0);} else {return null;}} 除了选择属性我们还可以根据我们的范围键指定顺序。 我们将使用scanIndexForward以降序查询登录表。 public ListMapString,AttributeValue fetchLoginsDesc(String email) {ListMapString,AttributeValue items new ArrayList();MapString,String expressionAttributesNames new HashMap();expressionAttributesNames.put(#email,email);MapString,AttributeValue expressionAttributeValues new HashMap();expressionAttributeValues.put(:emailValue,new AttributeValue().withS(email));QueryRequest queryRequest new QueryRequest().withTableName(TABLE_NAME).withKeyConditionExpression(#email :emailValue).withExpressionAttributeNames(expressionAttributesNames).withExpressionAttributeValues(expressionAttributeValues).withScanIndexForward(false);MapString,AttributeValue lastKey null;do {QueryResult queryResult amazonDynamoDB.query(queryRequest);ListMapString,AttributeValue results queryResult.getItems();items.addAll(results);lastKey queryResult.getLastEvaluatedKey();} while (lastKey!null);return items;} 数据库的常见功能是对集合中保留的项目进行计数。 在我们的情况下我们要计算特定用户的登录次数。 但是请特别注意因为计数功能只不过是对已获取的项目总数进行计数因此这将使您好像在获取项目一样花费很多。 public Integer countLogins(String email) {ListMapString,AttributeValue items new ArrayList();MapString,String expressionAttributesNames new HashMap();expressionAttributesNames.put(#email,email);MapString,AttributeValue expressionAttributeValues new HashMap();expressionAttributeValues.put(:emailValue,new AttributeValue().withS(email));QueryRequest queryRequest new QueryRequest().withTableName(TABLE_NAME).withKeyConditionExpression(#email :emailValue).withExpressionAttributeNames(expressionAttributesNames).withExpressionAttributeValues(expressionAttributeValues).withSelect(Select.COUNT);MapString,AttributeValue lastKey null;QueryResult queryResult amazonDynamoDB.query(queryRequest);ListMapString,AttributeValue results queryResult.getItems();return queryResult.getCount();} DynamoDB的另一个功能是批量获取项目即使它们属于不同的表也是如此。 在属于特定上下文的数据通过不同的表分布的情况下这确实很有用。 每个获取项都作为DynamoDB读取操作进行处理和收费。 如果是批处理获取项目则应指定所有表键因为BatchGetItem的每个查询的目的都是获取单个项目。 public MapString,ListMapString,AttributeValue getMultipleInformation(String email,String name) {MapString,KeysAndAttributes requestItems new HashMap();ListMapString,AttributeValue userKeys new ArrayList();MapString,AttributeValue userAttributes new HashMap();userAttributes.put(email,new AttributeValue().withS(email));userKeys.add(userAttributes);requestItems.put(UserRepository.TABLE_NAME,new KeysAndAttributes().withKeys(userKeys));ListMapString,AttributeValue supervisorKeys new ArrayList();MapString,AttributeValue supervisorAttributes new HashMap();supervisorAttributes.put(name,new AttributeValue().withS(name));supervisorKeys.add(supervisorAttributes);requestItems.put(SupervisorRepository.TABLE_NAME,new KeysAndAttributes().withKeys(supervisorKeys));BatchGetItemRequest batchGetItemRequest new BatchGetItemRequest();batchGetItemRequest.setRequestItems(requestItems);BatchGetItemResult batchGetItemResult amazonDynamoDB.batchGetItem(batchGetItemRequest);MapString,ListMapString,AttributeValue responses batchGetItemResult.getResponses();return responses;} 您可以在github上找到源代码 翻译自: https://www.javacodegeeks.com/2016/07/query-dynamodb-items-java-part-2.htmldynamodb java
http://www.yutouwan.com/news/197727/

相关文章:

  • 学做网站 为了熊掌号网站建设合同 费用
  • 东道 网站建设小广告发布
  • 谁有网站推荐一下好在线网站建设诚信经营
  • 网站特效网大连建设工程信息网华宇凤凰城东侧市政管网配套工程
  • 承德市网站开发大连企业建设网站
  • 网站页面效果图怎么做唐山做企业网站的公司
  • 网站开发前台mip网站怎么做匹配
  • 建设网站沙井东营网站设计公司
  • 网站从服务器上下载文件怎么做百度联盟网站
  • 抖音代运营服务流程南宁7天优化网络科技公司
  • 网站开发项目挣钱吗主体负责人和网站负责人不能是同一个人
  • 网站全屏代码泰安市住房和城乡建设厅网站
  • 怎样自己做网站卖钱重庆招聘一般上什么网站
  • 求推荐好的网站建设平台怎么制作网页
  • 深圳哪里有做网站的网站开发实验结论
  • 网站建设费用明细报价把里面的dede和plugins这2个文件夹覆盖到你的网站根目录
  • 哈尔滨网站小程序制作湘潭专业seo优化推荐
  • 深圳网站建设网站运营最吸引人的汽车广告语
  • 双轨网站开发简述网站的建设流程
  • 网站加速服务哈尔滨模板建站源码
  • 分析苏宁易购的网站建设未来网站建设想法
  • 哈尔滨网站外包wordpress ps.w.org
  • 水墨背景风格企业网站模板桂林漓江景区介绍
  • 网站卡的原因网站地址做图标
  • 网站响应式和非响应式网站做支付接口吗
  • 网站开发规划方案慧聪网郭凡生现状
  • 网站开发前途查询网站所有关键词排名
  • 云南高端网站制作价格上海市建设工程安全生产协会网站
  • 在国内怎么做国外网站企业网站建设专业的
  • 商务网站建设的基本流程罗湖商城网站建设哪家技术好