mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 00:56:02 +00:00
Fixed adding zset key
This commit is contained in:
@@ -75,21 +75,16 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if (type === 'zset' && item.records && Array.isArray(item.records)) {
|
} else if (type === 'zset' && item.records && Array.isArray(item.records)) {
|
||||||
const pairs = [];
|
for (const record of item.records) {
|
||||||
item.records.forEach(record => {
|
|
||||||
if (record.member && record.score) {
|
if (record.member && record.score) {
|
||||||
pairs.push(record.score, record.member);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (pairs.length > 0) {
|
|
||||||
await apiCall('database-connections/call-method', {
|
await apiCall('database-connections/call-method', {
|
||||||
conid,
|
conid,
|
||||||
database,
|
database,
|
||||||
method: typeConfig.addMethod,
|
method: typeConfig.addMethod,
|
||||||
args: [keyName, ...pairs],
|
args: [keyName, record.member, parseFloat(record.score)],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if (type === 'stream' && item.records && Array.isArray(item.records)) {
|
} else if (type === 'stream' && item.records && Array.isArray(item.records)) {
|
||||||
for (const record of item.records) {
|
for (const record of item.records) {
|
||||||
if (record.value) {
|
if (record.value) {
|
||||||
|
|||||||
Reference in New Issue
Block a user