令牌不支持的命令格式-'“”'Aerospike

阿瓦德什

我正在尝试在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'})

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章