mm_cachebase 1.4.6 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +225 -709
- package/compatibility_table.md +63 -0
- package/index.js +503 -1418
- package/package.json +41 -35
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
```markdown
|
|
2
|
+
# 三种缓存方式方法兼容性对比表格
|
|
3
|
+
|
|
4
|
+
## 核心缓存方法
|
|
5
|
+
|
|
6
|
+
| 方法名 | Redis | MongoDB | CacheBase | 状态说明 |
|
|
7
|
+
|-------|-------|---------|-----------|----------|
|
|
8
|
+
| set | ✅ | ✅ | ✅ | 完全兼容 |
|
|
9
|
+
| get | ✅ | ✅ | ✅ | 完全兼容 |
|
|
10
|
+
| del | ✅ | ✅ | ✅ | 完全兼容 |
|
|
11
|
+
| has | ❌ | ✅ | ✅ | Redis无此方法,CacheBase保持兼容 |
|
|
12
|
+
| clear | ❌ | ✅ | ✅ | Redis无此方法,CacheBase保持兼容 |
|
|
13
|
+
| keys | ✅ | ✅ | ✅ | 完全兼容 |
|
|
14
|
+
| ttl | ✅ | ❌ | ✅ | Redis原生支持,CacheBase模拟实现 |
|
|
15
|
+
| add | ❌ | ✅ | ✅ | Redis无此方法,CacheBase保持兼容 |
|
|
16
|
+
| addInt | ❌ | ✅ | ✅ | Redis无此方法,CacheBase保持兼容 |
|
|
17
|
+
| addStr | ❌ | ✅ | ✅ | Redis无此方法,CacheBase保持兼容 |
|
|
18
|
+
| sort | ✅ | ❌ | ✅ | Redis原生支持,CacheBase模拟实现 |
|
|
19
|
+
|
|
20
|
+
## Redis兼容方法 - 哈希表操作
|
|
21
|
+
|
|
22
|
+
| 方法名 | Redis | MongoDB | CacheBase | 状态说明 |
|
|
23
|
+
|-------|-------|---------|-----------|----------|
|
|
24
|
+
| hset | ✅ | ✅ | ✅ | 模拟实现,通过set对象方式 |
|
|
25
|
+
| hget | ✅ | ✅ | ✅ | 模拟实现,通过get对象方式 |
|
|
26
|
+
| hgetall | ✅ | ✅ | ✅ | 模拟实现,返回完整对象 |
|
|
27
|
+
| hdel | ✅ | ✅ | ✅ | 模拟实现,删除对象属性 |
|
|
28
|
+
| hexists | ✅ | ❌ | ❌ | Redis原生支持,CacheBase未实现 |
|
|
29
|
+
| hkeys | ✅ | ❌ | ❌ | Redis原生支持,CacheBase未实现 |
|
|
30
|
+
| hvals | ✅ | ❌ | ❌ | Redis原生支持,CacheBase未实现 |
|
|
31
|
+
|
|
32
|
+
## Redis兼容方法 - 集合操作
|
|
33
|
+
|
|
34
|
+
| 方法名 | Redis | MongoDB | CacheBase | 状态说明 |
|
|
35
|
+
|-------|-------|---------|-----------|----------|
|
|
36
|
+
| sadd | ✅ | ❌ | ❌ | Redis原生支持,CacheBase未实现 |
|
|
37
|
+
| srem | ✅ | ❌ | ❌ | Redis原生支持,CacheBase未实现 |
|
|
38
|
+
| sismember | ✅ | ❌ | ❌ | Redis原生支持,CacheBase未实现 |
|
|
39
|
+
| smembers | ✅ | ❌ | ❌ | Redis原生支持,CacheBase未实现 |
|
|
40
|
+
| scard | ✅ | ❌ | ❌ | Redis原生支持,CacheBase未实现 |
|
|
41
|
+
|
|
42
|
+
## Redis兼容方法 - 有序集合操作
|
|
43
|
+
|
|
44
|
+
| 方法名 | Redis | MongoDB | CacheBase | 状态说明 |
|
|
45
|
+
|-------|-------|---------|-----------|----------|
|
|
46
|
+
| zadd | ✅ | ❌ | ❌ | Redis原生支持,CacheBase未实现 |
|
|
47
|
+
| zrem | ✅ | ❌ | ❌ | Redis原生支持,CacheBase未实现 |
|
|
48
|
+
| zrange | ✅ | ❌ | ❌ | Redis原生支持,CacheBase未实现 |
|
|
49
|
+
| zscore | ✅ | ❌ | ❌ | Redis原生支持,CacheBase未实现 |
|
|
50
|
+
|
|
51
|
+
## Redis兼容方法 - 其他常用命令
|
|
52
|
+
|
|
53
|
+
| 方法名 | Redis | MongoDB | CacheBase | 状态说明 |
|
|
54
|
+
|-------|-------|---------|-----------|----------|
|
|
55
|
+
| expire | ✅ | ❌ | ✅ | Redis原生支持,CacheBase通过ttl模拟 |
|
|
56
|
+
| incr | ✅ | ⚠️ | ✅ | Redis原生支持,MongoDB返回undefined,CacheBase通过addInt模拟 |
|
|
57
|
+
| decr | ✅ | ⚠️ | ✅ | Redis原生支持,MongoDB返回undefined,CacheBase通过addInt模拟 |
|
|
58
|
+
| exists | ✅ | ✅ | ✅ | 兼容,Redis原生支持 |
|
|
59
|
+
| mget | ✅ | ⚠️ | ✅ | Redis原生支持,CacheBase实现兼容 |
|
|
60
|
+
| mset | ✅ | ✅ | ✅ | Redis原生支持,CacheBase实现兼容 |
|
|
61
|
+
|
|
62
|
+
注:✅ 完全兼容/功能正常 | ⚠️ 部分兼容/有异常 | ❌ 不兼容/未实现
|
|
63
|
+
```
|