1. [root@localhost bin]# aql --help
  2. Usage: aql OPTIONS
  3.  
  4. OPTIONS
  5.  
  6. -h <host>
  7. The hostname to the server connect to. Default: 127.0.0.1
  8.  
  9. -p <port>
  10. The port number of the server to connect to. Default: 3000
  11.  
  12. -U <user name>
  13. User name used to authenticate with cluster. Default: none
  14.  
  15. -P[<password>]
  16. Password used to authenticate with cluster. Default: none
  17.  
  18. User will be prompted on command line if -P specified and no password is given.
  19.  
  20. -c <command>
  21. Execute the specified command.
  22.  
  23. -f <filepath>
  24. Execute the commands in the specified file.
  25.  
  26. -v
  27. Enable verbose output. Default: disabled
  28.  
  29. -e
  30. Enable echoing of commands. Default disabled
  31.  
  32. -M
  33. Result display disabled. Default display enabled
  34.  
  35. -q
  36. Scan queue size. Default 3
  37.  
  38. -T <milliseconds>
  39. Set the timeout (ms) for commands. Default: 1000
  40.  
  41. -S
  42. Enable SLAP mode for queries. Default: disabled
  43.  
  44. -t <n>
  45. Number of batch threads for SLAP mode. Default: 10
  46.  
  47. -i <n>
  48. Number of iterations per thread for SLAP mode. Default: 10
  49.  
  50. -o (json | table)
  51. Set the output mode. Default: table
  52.  
  53. -F <file path>
  54. Set output file path. Default: /dev/null
  55.  
  56. -u <path>
  57. Path to User managed UDF modules.
  58. Default: /opt/aerospike/usr/udf/lua
  59.  
  60. -s <path>
  61. Path to the System managed UDF modules.
  62. Default: /opt/aerospike/sys/udf/lua
  63.  
  64. -d
  65. Run in debug mode.
  66.  
  67. --help
  68. Prints this message.
  69.  
  70. COMMANDS
  71.  
  72. DDL
  73. CREATE INDEX <index> ON <ns>[.<set>] (<bin>) NUMERIC|STRING
  74. CREATE LIST/MAPKEYS/MAVALUES INDEX <index> ON <ns>[.<set>] (<bin>) NUMERIC|STRING
  75. DROP INDEX <ns>[.<set>] <index>
  76. REPAIR INDEX <index> ON <ns>[.<set>]
  77.  
  78. <ns> is the namespace for the index.
  79. <set> is the set name for the index.
  80. <index> is the name of the index.
  81.  
  82. Examples:
  83.  
  84. CREATE INDEX idx_foo ON test.demo (foo) NUMERIC
  85. DROP INDEX test.demo idx_foo
  86. REPAIR INDEX idx_foo ON test.demo
  87.  
  88. DML
  89. INSERT INTO <ns>[.<set>] (PK, <bins>) VALUES (<key>, <values>)
  90. DELETE FROM <ns>[.<set>] WHERE PK = <key>
  91.  
  92. <ns> is the namespace for the record.
  93. <set> is the set name for the record.
  94. <key> is the record's primary key.
  95. <key> is the record's primary key.
  96. <bins> is a comma-separated list of bin names.
  97. <values> is comma-separated list of bin values. Keep it NULL (case insensitive & w/o quotes) to delete the bin
  98.  
  99. Examples:
  100.  
  101. INSERT INTO test.demo (PK, foo, bar) VALUES ('key1', 123, 'abc')
  102. DELETE FROM test.demo WHERE PK = 'key1'
  103.  
  104. QUERY
  105. SELECT <bins> FROM <ns>[.<set>]
  106. SELECT <bins> FROM <ns>[.<set>] WHERE <bin> = <value>
  107. SELECT <bins> FROM <ns>[.<set>] WHERE <bin> BETWEEN <lower> AND <upper>
  108. SELECT <bins> FROM <ns>[.<set>] WHERE PK = <key>
  109. SELECT <bins> FROM <ns>[.<set>] IN <indextype> WHERE <bin> = <value>
  110. SELECT <bins> FROM <ns>[.<set>] IN <indextype> WHERE <bin> BETWEEN <lower> AND <upper>
  111.  
  112. <ns> is the namespace for the records to be queried.
  113. <set> is the set name for the record to be queried.
  114. <key> is the record's primary key.
  115. <bin> is the name of a bin.
  116. <value> is the value of a bin.
  117. <indextype> is the type of a index user wants to query. (LIST/MAPKEYS/MAPVALUES)
  118. <bins> can be either a wildcard (*) or a comma-separated list of bin names.
  119. <lower> is the lower bound for a numeric range query.
  120. <upper> is the lower bound for a numeric range query.
  121.  
  122. Examples:
  123.  
  124. SELECT * FROM test.demo
  125. SELECT * FROM test.demo WHERE PK = 'key1'
  126. SELECT foo, bar FROM test.demo WHERE PK = 'key1'
  127. SELECT foo, bar FROM test.demo WHERE foo = 123
  128. SELECT foo, bar FROM test.demo WHERE foo BETWEEN 0 AND 999
  129.  
  130. MANAGE UDFS
  131. REGISTER MODULE '<filepath>'
  132. SHOW MODULES
  133. REMOVE MODULE <filename>
  134. DESC MODULE <filename>
  135.  
  136. <filepath> is file path to the UDF module(in single quotes).
  137. <filename> is file name of the UDF module.
  138.  
  139. Examples:
  140.  
  141. REGISTER MODULE '~/test.lua'
  142. SHOW MODULES
  143. DESC MODULE test.lua
  144. REMOVE MODULE test.lua
  145.  
  146. INVOKING UDFS
  147. EXECUTE <module>.<function>(<args>) ON <ns>[.<set>]
  148. EXECUTE <module>.<function>(<args>) ON <ns>[.<set>] WHERE PK = <key>
  149. AGGREGATE <module>.<function>(<args>) ON <ns>[.<set>] WHERE <bin> = <value>
  150. AGGREGATE <module>.<function>(<args>) ON <ns>[.<set>] WHERE <bin> BETWEEN <lower> AND <upper>
  151.  
  152. <module> is UDF module containing the function to invoke.
  153. <function> is UDF to invoke.
  154. <args> is a comma-separated list of argument values for the UDF.
  155. <ns> is the namespace for the records to be queried.
  156. <set> is the set name for the record to be queried.
  157. <key> is the record's primary key.
  158. <bin> is the name of a bin.
  159. <value> is the value of a bin.
  160. <lower> is the lower bound for a numeric range query.
  161. <upper> is the lower bound for a numeric range query.
  162.  
  163. Examples:
  164.  
  165. EXECUTE myudfs.udf1(2) ON test.demo
  166. EXECUTE myudfs.udf1(2) ON test.demo WHERE PK = 'key1'
  167. AGGREGATE myudfs.udf2(2) ON test.demo WHERE foo = 123
  168. AGGREGATE myudfs.udf2(2) ON test.demo WHERE foo BETWEEN 0 AND 999
  169.  
  170. INFO
  171. SHOW NAMESPACES | SETS | BINS | INDEXES
  172. SHOW SCANS | QUERIES
  173. STAT NAMESPACE <ns> | INDEX <ns> <indexname>
  174. STAT SYSTEM
  175.  
  176. JOB MANAGEMENT
  177. KILL_QUERY <transaction_id>
  178. KILL_SCAN <scan_id>
  179.  
  180. USER ADMINISTRATION
  181. CREATE USER <user> PASSWORD <password> ROLE[S] <role1>,<role2>...
  182. pre-defined roles: read|read-write|read-write-udf|sys-admin|user-admin
  183. DROP USER <user>
  184. SET PASSWORD <password> [FOR <user>]
  185. GRANT ROLE[S] <role1>,<role2>... TO <user>
  186. REVOKE ROLE[S] <role1>,<role2>... FROM <user>
  187. CREATE ROLE <role> PRIVILEGE[S] <priv1[.ns1[.set1]]>,<priv2[.ns2[.set2]]>...
  188. priv: read|read-write|read-write-udf|sys-admin|user-admin
  189. ns: namespace. Applies to all namespaces if not set.
  190. set: set name. Applie to all sets within namespace if not set.
  191. sys-admin and user-admin can't be qualified with namespace or set.
  192. DROP ROLE <role>
  193. GRANT PRIVILEGE[S] <priv1[.ns1[.set1]]>,<priv2[.ns2[.set2]]>... TO <role>
  194. REVOKE PRIVILEGE[S] <priv1[.ns1[.set1]]>,<priv2[.ns2[.set2]]>... FROM <role>
  195. SHOW USER [<user>]
  196. SHOW USERS
  197. SHOW ROLE <role>
  198. SHOW ROLES
  199.  
  200. SETTINGS
  201. TIMEOUT (time in ms, default: 1000 ms)
  202. RECORD_TTL (time in ms, default: 0 ms)
  203. VERBOSE (true | false, default false)
  204. ECHO (true | false, default false)
  205. FAIL_ON_CLUSTER_CHANGE (true | false, default true, policy applies to scans)
  206. OUTPUT (table | json, default table)
  207. LUA_USERPATH <path>, default : /opt/aerospike/usr/udf/lua
  208. LUA_SYSPATH <path>, default : /opt/aerospike/sys/udf/lua
  209.  
  210. To get the value of a setting, run:
  211.  
  212. aql> GET <setting>
  213.  
  214. To set the value of a setting, run:
  215.  
  216. aql> SET <setting> <value>
  217.  
  218. OTHER
  219. RUN <filepath>
  220. HELP
  221. QUIT|EXIT|Q
  222. Aerospike Query
  223. Copyright 2013 Aerospike. All rights reserved.

添加一条记录:

  1. aql> INSERT INTO test.set_fir (PK,uid,uname) VALUES ('key',1,'Aerospike')
  2. OK, 1 record affected.

  

查询:

  1. aql> select * from test.set_fir
  2. +-----+-------------+
  3. | uid | uname |
  4. +-----+-------------+
  5. | 1 | "Aerospike" |
  6. +-----+-------------+
  7. 1 row in set (0.048 secs)

  

删除set:test.demo11 中的数据:

  1. aql> DELETE FROM test.set_fir WHERE PK = 'key'
  2. OK, 1 record affected.

也可以:

  1. [root@localhost bin]# asinfo -v "set-config:context=namespace;id=test;set=set_fir;set-delete=true;"
  2. ok

  

  1. [root@localhost ~]# asinfo -v "set-config:context=namespace;id=test;set=demo11;set-delete=true;"
  2. ok

  

查询:

  1. aql> select * from test.demo11
  2. 0 rows in set (0.068 secs)

  

Aerospike系列:4:简单的增删改查aql的更多相关文章

  1. JS组件系列——BootstrapTable+KnockoutJS实现增删改查解决方案(一)

    前言:出于某种原因,需要学习下Knockout.js,这个组件很早前听说过,但一直没尝试使用,这两天学习了下,觉得它真心不错,双向绑定的机制简直太爽了.今天打算结合bootstrapTable和Kno ...

  2. JS组件系列——BootstrapTable+KnockoutJS实现增删改查解决方案(四):自定义T4模板快速生成页面

    前言:上篇介绍了下ko增删改查的封装,确实节省了大量的js代码.博主是一个喜欢偷懒的人,总觉得这些基础的增删改查效果能不能通过一个什么工具直接生成页面效果,啥代码都不用写了,那该多爽.于是研究了下T4 ...

  3. JS组件系列——BootstrapTable+KnockoutJS实现增删改查解决方案(三):两个Viewmodel搞定增删改查

    前言:之前博主分享过knockoutJS和BootstrapTable的一些基础用法,都是写基础应用,根本谈不上封装,仅仅是避免了html控件的取值和赋值,远远没有将MVVM的精妙展现出来.最近项目打 ...

  4. JS组件系列——BootstrapTable+KnockoutJS实现增删改查解决方案(二)

    前言:上篇 JS组件系列——BootstrapTable+KnockoutJS实现增删改查解决方案(一) 介绍了下knockout.js的一些基础用法,由于篇幅的关系,所以只能分成两篇,望见谅!昨天就 ...

  5. BitAdminCore框架应用篇:(二)创建一个简单的增删改查模块

    NET Core应用框架之BitAdminCore框架应用篇系列 框架演示:http://bit.bitdao.cn 框架源码:https://github.com/chenyinxin/cookie ...

  6. salesforce 零基础学习(五十一)使用 Salesforce.com SOAP API 实现用户登录以及简单的增删改查(JAVA访问salesforce)

    此篇请参看:https://resources.docs.salesforce.com/202/latest/en-us/sfdc/pdf/salesforce_developer_environme ...

  7. MyBatis学习--简单的增删改查

    jdbc程序 在学习MyBatis的时候先简单了解下JDBC编程的方式,我们以一个简单的查询为例,使用JDBC编程,如下: Public static void main(String[] args) ...

  8. 通过JDBC进行简单的增删改查

    通过JDBC进行简单的增删改查(以MySQL为例) 目录 前言:什么是JDBC 一.准备工作(一):MySQL安装配置和基础学习 二.准备工作(二):下载数据库对应的jar包并导入 三.JDBC基本操 ...

  9. MyBatis简单的增删改查以及简单的分页查询实现

    MyBatis简单的增删改查以及简单的分页查询实现 <? xml version="1.0" encoding="UTF-8"? > <!DO ...

随机推荐

  1. 霍夫曼编码(Huffman Coding)

    霍夫曼编码(Huffman Coding)是一种编码方法,霍夫曼编码是可变字长编码(VLC)的一种. 霍夫曼编码使用变长编码表对源符号(如文件中的一个字母)进行编码,其中变长编码表是通过一种评估来源符 ...

  2. linux syslog详解 转

    分三部分 一.syslog协议介绍 二.syslog函数 三.linux syslog配置   一.syslog协议介绍 1.介绍 在Unix类操作系统上,syslog广泛应用于系统日志.syslog ...

  3. 低版本系统兼容的ActionBar(七)自定义Actionbar标题栏字体

    这个自定义字体其实和ActionBar有关,但之前写AtionBar的时候没考虑到修改字体样式,今天看到一篇专门写这个的文章就贴上使用方式.╮(╯▽╰)╭,不得不说Actionbar的那个样式真是让人 ...

  4. MyEclipse的破解和汉化方法

    一.安装和破解 我的MyEclipse是从官网下的正版软件,在其他地方下载的版本同理. 官方下载地址(需FQ): http://www.myeclipseide.com/module-htmlpage ...

  5. <A>标签电子邮件链接

    电子邮件链接 – 要链接电子邮件,可在链接标签中插入” mailto:邮箱地址” <A href="mailto:webmaster@sohu.com"> 站长信箱 & ...

  6. [Web 前端] 流行的JavaScript库 ——jQuery

    cp : https://www.cnblogs.com/zhoushihui/p/5141767.html   1.为了简化 JavaScript 的开发, 一些 JavsScript 库诞生了. ...

  7. 解析eml文件

    之前使用lumisoft解析eml,总是会出现很奇怪的问题,所以改使用微软自家的com库,确实厉害兼容性更好,代码 string file = emailPath; CDO.Message oMsg ...

  8. MyBatis动态SQL foreach标签实现批量插入

    需求:查出给定id的记录: <select id="getEmpsByConditionForeach" resultType="com.test.beans.Em ...

  9. 亚马逊AWS CentOS7(linux)改为用户名密码登录

    1.进入AWS系统 略 系统为:centos 7 fox.风 2.设置ROOT密码 sudo passwd root 1 3.修改配置文件 sudo vim /etc/ssh/sshd_config ...

  10. JavaScript中textRange对象使用方法总结

    TextRange对象是动态HTML(DHTML)的高级特性,使用它可以实现很多和文本有关的任务,例如搜索和选择文本.文本范围让您可以选择性的将字符.单词和句子从文档中挑选出来.TextRange对象 ...