【问题标题】:How to get records without metadata in aerospike如何在 aerospike 中获取没有元数据的记录
【发布时间】:2017-07-12 06:29:59
【问题描述】:
config = {'hosts': [('127.0.0.1', 3000)]}

client = aerospike.client(config).connect()


def print_result(record):
    print(record)

尝试:

query = client.query('test_test', 'demo')
query.select('email')
query.where(p.between('id', 1, 25))
query.foreach(print_result)

这是我在 python 客户端中的 aerospike 示例代码,我正在获取带有元数据的记录,如何只获取没有元数据的记录

【问题讨论】:

    标签: python aerospike


    【解决方案1】:

    通过给出 print(record[2]) 我们只会得到记录。

    【讨论】:

    • 你只会得到垃圾箱。记录是 (key, metadata, bins) 的元组。垃圾箱不是记录,它们是记录的数据部分。记录就是那个元组。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-29
    • 2013-09-02
    • 1970-01-01
    相关资源
    最近更新 更多