aerospike - 不支持的带有 token 的命令格式 - '""' Aerospike

标签 aerospike aql

我正尝试在 aerospike 中插入一条记录,如下所示:

insert into NameSpace.SetName(PK,id,value,formId) values("1","23","hello","");

我收到以下错误:

Unsupported command format with token -  '""' 
Make sure string values are enclosed in quotes.
Type " aql --help " from console or simply "help" from within the aql- 
prompt. 

感谢任何帮助。

最佳答案

似乎对我有用:

$ aql
Seed:         127.0.0.1
User:         None
Aerospike Query Client
Version 3.15.3.14
C Client Version 4.3.12
Copyright 2012-2017 Aerospike. All rights reserved.
aql> insert into test.stackoverflow (PK,id,value,formId) values("1","23","hello","");
OK, 1 record affected.

aql> select * from test.stackoverflow where PK="1"
+------+---------+--------+
| id   | value   | formId |
+------+---------+--------+
| "23" | "hello" | ""     |
+------+---------+--------+
1 row in set (0.011 secs)

OK

服务器版本是

$ asd --version
Aerospike Community Edition build 4.3.0.2

或者,使用其中一种语言客户端。您不应该尝试通过 AQL 构建应用程序,它只是一个用于管理的工具(具有轻量级数据浏览)。

安装

$ sudo yum install python-devel
$ sudo yum install openssl-devel
$ pip install aerospike
$ python

运行

>>> import aerospike
>>> config = {'hosts': [('127.0.0.1', 3000)]}
>>> client = aerospike.client(config).connect()
>>> key = ('test', 'stackoverflow', '1')
>>> client.put(key, {'id': '23', 'value': 'hello', 'formId': ''})
0L
>>> import pprint
>>> pprint.pprint(client.get(key))
(('test',
  'stackoverflow',
  None,
  bytearray(b'CHu\xf09%a\xf0\x8d\x86\x14\x0f\xea\x93\xeb\xf6\x7f\x16\x87\xd0')),
 {'gen': 1, 'ttl': 431818},
 {'formId': '', 'id': '23', 'value': 'hello'})

关于aerospike - 不支持的带有 token 的命令格式 - '""' Aerospike,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52383494/

相关文章:

java - 使用 Aerospike bin 名称的最佳做法是什么?

backup - 恢复 Aerospike 中的备份

redhat - 如何在同一 L2 网络上创建两个 Aerospike 集群

javascript - Arango AQL 删除文档和边缘

阿兰戈DB : How to get all the possible paths between 2 vertices?

arangodb - 如何将 ArangoDb 中的结果分组为单个记录?

java - 执行 put through java 客户端时出现 Aerospike 异常错误代码 4 参数错误

caching - Aerospike 特定于 setName 的配置

ArangoDB 列出组中的对象数据 (AQL)

arangodb - AQL 返回平面合并列表