2.2. 添加缓存条目
在 data 容器中创建 key:value
对条目。
先决条件
创建可存储数据的数据网格缓存。
流程
- 创建与 Data Grid 的 CLI 连接。
在缓存中添加条目,如下所示:
从缓存的上下文使用
put
命令:[//containers/default/caches/mycache]> put hello world
[//containers/default/caches/mycache]> put hello world
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 在
put
命令中使用--cache=
:[//containers/default]> put --cache=mycache hello world
[//containers/default]> put --cache=mycache hello world
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
使用
get
命令验证条目。[//containers/default/caches/mycache]> get hello world
[//containers/default/caches/mycache]> get hello world
Copy to Clipboard Copied! Toggle word wrap Toggle overflow