Fixed adding zset key

This commit is contained in:
Stela Augustinova
2025-12-18 16:26:32 +01:00
parent 6905e4a2a1
commit 90316f106a

View File

@@ -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) {