gpt4 book ai didi

hash - 如何在 Aerospike 中通过哈希摘要获取记录

转载 作者:行者123 更新时间:2023-12-03 00:02:08 25 4
gpt4 key购买 nike

我可以通过以前保存的哈希摘要从 aerospike 数据库检索记录吗?

最佳答案

以下是如何在 Python 的 Aerospike 客户端中执行此操作的示例。 Client.get需要有效的key tuple ,可以是(命名空间、集合、、摘要),而不是更标准的(命名空间、集合、主键)。

>>> client = aerospike.client(config).connect()
>>> client.put(('test','demo','oof'), {'id':0, 'a':1})
>>> (key, meta, bins) = client.get(('test','demo','oof'))
>>> key
('test', 'demo', None, bytearray(b'\ti\xcb\xb9\xb6V#V\xecI#\xealu\x05\x00H\x98\xe4='))
>>> (key2, meta2, bins2) = client.get(key)
>>> bins2
{'a': 1, 'id': 0}
>>> client.close()

关于hash - 如何在 Aerospike 中通过哈希摘要获取记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42221889/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com