修改模版内容
This commit is contained in:
@@ -83,16 +83,16 @@ def create_connection(config):
|
||||
|
||||
使用示例:
|
||||
config = {
|
||||
'hosts': ['192.168.1.100', '192.168.1.101'],
|
||||
'hosts': ['127.0.0.1'],
|
||||
'port': 9042,
|
||||
'username': 'cassandra',
|
||||
'password': 'password',
|
||||
'keyspace': 'my_keyspace',
|
||||
'keyspace': 'example_keyspace',
|
||||
'datacenter': 'dc1'
|
||||
}
|
||||
cluster, session = create_connection(config)
|
||||
if session:
|
||||
result = session.execute("SELECT * FROM my_table LIMIT 10")
|
||||
result = session.execute("SELECT * FROM example_table LIMIT 10")
|
||||
cluster.shutdown()
|
||||
"""
|
||||
start_time = time.time()
|
||||
|
@@ -65,7 +65,7 @@ def get_redis_value_with_type(redis_client, key):
|
||||
- 数据异常:记录警告并提供基本信息
|
||||
|
||||
示例:
|
||||
>>> result = get_redis_value_with_type(client, "user:1001")
|
||||
>>> result = get_redis_value_with_type(client, "user:example")
|
||||
>>> print(result['type']) # 'string'
|
||||
>>> print(result['value']) # 'John Doe'
|
||||
>>> print(result['exists']) # True
|
||||
|
Reference in New Issue
Block a user