我有以下数据结构格式:
unix/:/var/run/tarantool/tarantool.sock> s:format()
---
- [{'name': 'id', 'type': 'unsigned'}, {'name': 'version', 'type': 'array'}, {'name': 'data',
'type': 'array'}]
...我在里面已经有了以下数据:
unix/:/var/run/tarantool/tarantool.sock> s:select{}
---
- - [0, [[21, 'action123'], [12, 'actionXYZ'], [11, 'actionABC']], [['actionXYZ',
'SOME_JAVASCRIPT_CONTENT']]]
- [1, [[33, 'action123'], [12, 'baseXYZ'], [11, 'baseABC']], [['bas123', 'SOME_CSS_CONTENT']]]
...我已经阅读了参考资料和文档,我有点迷失在完成以下内容:
version 12 of12的条目。带有字段名的
我在我的中有一个名为元组的format() --当我查询数据时,我怎么能看到这些名称呢?
{“名称”:“id”,“键入”:“无符号”},{“名称”:“版本”,“类型”:“数组”},{“名称”:“数据”,“类型”:“数组”}]
我试着使用https://www.tarantool.io/en/doc/2.2/reference/reference_lua/yaml/来包装我的select语句,但是没有什么效果。
发布于 2020-02-20 17:03:53
https://www.tarantool.io/en/doc/2.2/reference/reference_lua/box_index/
tuple:tomap():使用
,
tarantool> box.space.TEST:pairs():map(function(x) return x:tomap({names_only=true}) end):totable()
---
- - COLUMN1: 1
COLUMN2: a
- COLUMN1: 13
COLUMN2: a
- COLUMN1: 1000
COLUMN2: ahttps://stackoverflow.com/questions/60120678
复制相似问题