create_index
创建索引
声明
bool create_index(string index_name, mixed key_list_or_dict, bool is_unique = false, mixed expire_after_seconds = nil)
参数
| 参数名 | 描述 |
|---|---|
| index_name | 索引名称 |
| key_list_or_dict | 索引键列表 array: 索引键列表,按升序排序 map: 索引键字典,每个字段可以设置升序或者降序排序 key: 索引键 value: =1 升序,=-1 降序 |
| is_unique | 索引类型是否为'unique' |
| expire_after_seconds | 索引有效期 |
返回值
true - 创建成功, false - 创建失败