[root@localhost bin]# aql --help
Usage: aql OPTIONS OPTIONS -h <host>
The hostname to the server connect to. Default: 127.0.0.1 -p <port>
The port number of the server to connect to. Default: 3000 -U <user name>
User name used to authenticate with cluster. Default: none -P[<password>]
Password used to authenticate with cluster. Default: none User will be prompted on command line if -P specified and no password is given. -c <command>
Execute the specified command. -f <filepath>
Execute the commands in the specified file. -v
Enable verbose output. Default: disabled -e
Enable echoing of commands. Default disabled -M
Result display disabled. Default display enabled -q
Scan queue size. Default 3 -T <milliseconds>
Set the timeout (ms) for commands. Default: 1000 -S
Enable SLAP mode for queries. Default: disabled -t <n>
Number of batch threads for SLAP mode. Default: 10 -i <n>
Number of iterations per thread for SLAP mode. Default: 10 -o (json | table)
Set the output mode. Default: table -F <file path>
Set output file path. Default: /dev/null -u <path>
Path to User managed UDF modules.
Default: /opt/aerospike/usr/udf/lua -s <path>
Path to the System managed UDF modules.
Default: /opt/aerospike/sys/udf/lua -d
Run in debug mode. --help
Prints this message. COMMANDS DDL
CREATE INDEX <index> ON <ns>[.<set>] (<bin>) NUMERIC|STRING
CREATE LIST/MAPKEYS/MAVALUES INDEX <index> ON <ns>[.<set>] (<bin>) NUMERIC|STRING
DROP INDEX <ns>[.<set>] <index>
REPAIR INDEX <index> ON <ns>[.<set>] <ns> is the namespace for the index.
<set> is the set name for the index.
<index> is the name of the index. Examples: CREATE INDEX idx_foo ON test.demo (foo) NUMERIC
DROP INDEX test.demo idx_foo
REPAIR INDEX idx_foo ON test.demo DML
INSERT INTO <ns>[.<set>] (PK, <bins>) VALUES (<key>, <values>)
DELETE FROM <ns>[.<set>] WHERE PK = <key> <ns> is the namespace for the record.
<set> is the set name for the record.
<key> is the record's primary key.
<key> is the record's primary key.
<bins> is a comma-separated list of bin names.
<values> is comma-separated list of bin values. Keep it NULL (case insensitive & w/o quotes) to delete the bin Examples: INSERT INTO test.demo (PK, foo, bar) VALUES ('key1', 123, 'abc')
DELETE FROM test.demo WHERE PK = 'key1' QUERY
SELECT <bins> FROM <ns>[.<set>]
SELECT <bins> FROM <ns>[.<set>] WHERE <bin> = <value>
SELECT <bins> FROM <ns>[.<set>] WHERE <bin> BETWEEN <lower> AND <upper>
SELECT <bins> FROM <ns>[.<set>] WHERE PK = <key>
SELECT <bins> FROM <ns>[.<set>] IN <indextype> WHERE <bin> = <value>
SELECT <bins> FROM <ns>[.<set>] IN <indextype> WHERE <bin> BETWEEN <lower> AND <upper> <ns> is the namespace for the records to be queried.
<set> is the set name for the record to be queried.
<key> is the record's primary key.
<bin> is the name of a bin.
<value> is the value of a bin.
<indextype> is the type of a index user wants to query. (LIST/MAPKEYS/MAPVALUES)
<bins> can be either a wildcard (*) or a comma-separated list of bin names.
<lower> is the lower bound for a numeric range query.
<upper> is the lower bound for a numeric range query. Examples: SELECT * FROM test.demo
SELECT * FROM test.demo WHERE PK = 'key1'
SELECT foo, bar FROM test.demo WHERE PK = 'key1'
SELECT foo, bar FROM test.demo WHERE foo = 123
SELECT foo, bar FROM test.demo WHERE foo BETWEEN 0 AND 999 MANAGE UDFS
REGISTER MODULE '<filepath>'
SHOW MODULES
REMOVE MODULE <filename>
DESC MODULE <filename> <filepath> is file path to the UDF module(in single quotes).
<filename> is file name of the UDF module. Examples: REGISTER MODULE '~/test.lua'
SHOW MODULES
DESC MODULE test.lua
REMOVE MODULE test.lua INVOKING UDFS
EXECUTE <module>.<function>(<args>) ON <ns>[.<set>]
EXECUTE <module>.<function>(<args>) ON <ns>[.<set>] WHERE PK = <key>
AGGREGATE <module>.<function>(<args>) ON <ns>[.<set>] WHERE <bin> = <value>
AGGREGATE <module>.<function>(<args>) ON <ns>[.<set>] WHERE <bin> BETWEEN <lower> AND <upper> <module> is UDF module containing the function to invoke.
<function> is UDF to invoke.
<args> is a comma-separated list of argument values for the UDF.
<ns> is the namespace for the records to be queried.
<set> is the set name for the record to be queried.
<key> is the record's primary key.
<bin> is the name of a bin.
<value> is the value of a bin.
<lower> is the lower bound for a numeric range query.
<upper> is the lower bound for a numeric range query. Examples: EXECUTE myudfs.udf1(2) ON test.demo
EXECUTE myudfs.udf1(2) ON test.demo WHERE PK = 'key1'
AGGREGATE myudfs.udf2(2) ON test.demo WHERE foo = 123
AGGREGATE myudfs.udf2(2) ON test.demo WHERE foo BETWEEN 0 AND 999 INFO
SHOW NAMESPACES | SETS | BINS | INDEXES
SHOW SCANS | QUERIES
STAT NAMESPACE <ns> | INDEX <ns> <indexname>
STAT SYSTEM JOB MANAGEMENT
KILL_QUERY <transaction_id>
KILL_SCAN <scan_id> USER ADMINISTRATION
CREATE USER <user> PASSWORD <password> ROLE[S] <role1>,<role2>...
pre-defined roles: read|read-write|read-write-udf|sys-admin|user-admin
DROP USER <user>
SET PASSWORD <password> [FOR <user>]
GRANT ROLE[S] <role1>,<role2>... TO <user>
REVOKE ROLE[S] <role1>,<role2>... FROM <user>
CREATE ROLE <role> PRIVILEGE[S] <priv1[.ns1[.set1]]>,<priv2[.ns2[.set2]]>...
priv: read|read-write|read-write-udf|sys-admin|user-admin
ns: namespace. Applies to all namespaces if not set.
set: set name. Applie to all sets within namespace if not set.
sys-admin and user-admin can't be qualified with namespace or set.
DROP ROLE <role>
GRANT PRIVILEGE[S] <priv1[.ns1[.set1]]>,<priv2[.ns2[.set2]]>... TO <role>
REVOKE PRIVILEGE[S] <priv1[.ns1[.set1]]>,<priv2[.ns2[.set2]]>... FROM <role>
SHOW USER [<user>]
SHOW USERS
SHOW ROLE <role>
SHOW ROLES SETTINGS
TIMEOUT (time in ms, default: 1000 ms)
RECORD_TTL (time in ms, default: 0 ms)
VERBOSE (true | false, default false)
ECHO (true | false, default false)
FAIL_ON_CLUSTER_CHANGE (true | false, default true, policy applies to scans)
OUTPUT (table | json, default table)
LUA_USERPATH <path>, default : /opt/aerospike/usr/udf/lua
LUA_SYSPATH <path>, default : /opt/aerospike/sys/udf/lua To get the value of a setting, run: aql> GET <setting> To set the value of a setting, run: aql> SET <setting> <value> OTHER
RUN <filepath>
HELP
QUIT|EXIT|Q
Aerospike Query
Copyright 2013 Aerospike. All rights reserved.

添加一条记录:

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

  

查询:

aql> select * from test.set_fir
+-----+-------------+
| uid | uname |
+-----+-------------+
| 1 | "Aerospike" |
+-----+-------------+
1 row in set (0.048 secs)

  

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

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

也可以:

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

  

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

  

查询:

aql> select * from test.demo11
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. App.config和Web.config配置文件的配置节点的解析

    前言 在http://www.cnblogs.com/aehyok/p/3558661.html这篇博文中,大致对配置文件有了初步的了解,并且在文中有提到过<appSettings>和&l ...

  2. 开源项目MultiChoiceAdapter详解(一)——概要介绍

    项目地址:https://github.com/ManuelPeinado/MultiChoiceAdapter 这个项目主要是提供了一个多选适配器,使用者可以用它来替换传统的适配器,用途还算比较广泛 ...

  3. 通过AnimationSet设置动画

    在代码中可以通过set来设置多个动画属性,这里分开来设置不同的属性. 首先先贴上布局文件,里面的imageview是用来做动画的控件 <RelativeLayout xmlns:android= ...

  4. Orchard 前台权限与自定义权限

    一:关于前台权限 1:只允许自己看到 首先,我们需要确定在 Role 设置页面,用户所对应的 View Page by others 和 View all content 未被选中.备注,我们首先和得 ...

  5. BZOJ1337: 最小圆覆盖

    题目:求n个点的最小圆覆盖. 题解:最小圆覆盖,上模板.复杂度证明可以戳:这里 代码: #include<cstdio> #include<cstdlib> #include& ...

  6. OA系统权限管理设计方案【转】

    l 不同职责的人员,对于系统操作的权限应该是不同的.优秀的业务系统,这是最基本的功能. l 可以对“组”进行权限分配.对于一个大企业的业务系统来说,如果要求管理员为其下员工逐一分配系统操作权限的话,是 ...

  7. 数学图形(1.47)贝塞尔(Bézier)曲线

    贝塞尔曲线又称贝兹曲线或贝济埃曲线,是由法国数学家Pierre Bézier所发现,由此为计算机矢量图形学奠定了基础.它的主要意义在于无论是直线或曲线都能在数学上予以描述. 上一节讲的是高次方程曲线, ...

  8. Mockito 的使用

    转自:Mockito 中文文档 ( 2.0.26 beta ) 转自:手把手教你 Mockito 的使用 参数匹配器 Argument Matcher(参数匹配器) Mockito通过equals() ...

  9. window.open 浏览器差异.

    首先引入 w3help的,莫的测试: 原帖地址:http://www.w3help.org/zh-cn/causes/BX1053   w3help的测试,和我的测试相互补充,应该比较完整了.悲剧的是 ...

  10. VS2010新建Web网站与新建Web应用程序的区别 (转)

    在Visual Studio 2010中,除了可以使用“创建Web应用程序”的方式来构建自己的Web项目之外,还可以通过创建“Web网站”的方式来构建Web项其中,Web网站的创建方法:打开Visua ...