Aerospike aql 令牌附近的语法错误 - 确保字符串值包含在引号中

Aerospike aql Syntax error near token - Make sure string values are enclosed in quotes

我正在尝试从 aeropike 数据存储集中删除记录。 我正在使用给定 here.

的查询语言

但看起来查询的语法 error.I 已在查询和相应的错误下方给出。

Aerospike Query Client
Version 3.13.0.1
C Client Version 4.1.6
Copyright 2012-2016 Aerospike. All rights reserved.
aql> set  TIMEOUT 100000
aql> delete from test.User
Syntax error near token -  'delete from test.User'
Make sure string values are enclosed in quotes.
Type " aql --help " from console or simply "help" from within the aql-prompt.

aql> delete from 'test.User'
Syntax error near token -  'delete from 'test.User''
Make sure string values are enclosed in quotes.
Type " aql --help " from console or simply "help" from within the aql-prompt.

aql> truncate test.User

ERROR: 404: COMMAND NOT FOUND : truncate
aql> truncate test User

ERROR: 404: COMMAND NOT FOUND : truncate
aql> truncate ns

ERROR: 404: COMMAND NOT FOUND : truncate

aql> select '_id' from test.User
+-----------+
| _id       |
+-----------+
| "Dave-02" |
| "Dave-01" |
+-----------+
2 rows in set (1.413 secs)

aql> delete from test.User where '_id'="Dave-01"
Unsupported command format with token -  ''_id''
Make sure string values are enclosed in quotes.
Type " aql --help " from console or simply "help" from within the aql-prompt.


    aql>  show namespaces
    +------------+
    | namespaces |
    +------------+
    | "test"     |
    | "bar"      |
    +------------+
    2 rows in set (0.001 secs)
    OK

    aql> show sets
    +------------------+--------+----------------+---------+-------------------+--------------+-------------------+--------------+------------+
    | disable-eviction | ns     | set-enable-xdr | objects | stop-writes-count | set          | memory_data_bytes | truncate_lut | tombstones |
    +------------------+--------+----------------+---------+-------------------+--------------+-------------------+--------------+------------+
    | "false"          | "test" | "use-default"  | 0       | 0                 | "UserRecord" | 0                 | 0            | 0          |
    | "false"          | "bar"  | "use-default"  | 1       | 0                 | "UserRecord" | 1230              | 0            | 0          |
    +------------------+--------+----------------+---------+-------------------+--------------+-------------------+--------------+------------+
    2 rows in set (0.000 secs)
    OK

知道我的查询有什么问题吗? 提前致谢。

aql> insert into ns1.user (pk, name, age) values (1, 'Raj', 24)
OK, 1 record affected.

aql> insert into ns1.user (pk, name, age) values (2, 'Kumar', 24)
OK, 1 record affected.

aql> select * from ns1.user
+---------+-----+
| name    | age |
+---------+-----+
| "Raj"   | 24  |
| "Kumar" | 24  |
+---------+-----+
2 rows in set (0.039 secs)

OK

aql> delete from ns1.user where pk = 1
OK, 1 record affected.

aql> select * from ns1.user
+---------+-----+
| name    | age |
+---------+-----+
| "Kumar" | 24  |
+---------+-----+
1 row in set (0.038 secs)

OK

为了便于理解,进一步扩展示例(也将 key_send 设置为 true),展示截断的工作原理。

aql> set key_send true
KEY_SEND = true
aql> insert into ns1.user (pk, name, age) values (1, 'Raj', 24)
OK, 1 record affected.

aql> insert into ns1.user (pk, name, age) values (2, 'Kumar', 25)
OK, 1 record affected.

aql> select * from ns1.user
+----+---------+-----+
| PK | name    | age |
+----+---------+-----+
| 1  | "Raj"   | 24  |
| 2  | "Kumar" | 25  |
+----+---------+-----+
2 rows in set (0.037 secs)

OK

aql> truncate ns1.user
OK

aql> select * from ns1.user
0 rows in set (0.036 secs)

OK