Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
实际上,有一个任务-从以下字段收集使用情况统计信息:cnt, value, max,min
cnt
value
max
min
我想一口气做完所有事情upsert。cnt设置通过+,value通过=
upsert
+
=
我不明白如何制作 min 字段:
只需before_replace触发空间,如果旧值丢失,它将返回一个新值,否则返回一个修改后的值。大约是这样的:
before_replace
function trigger_before_update_space1 (old, new) return old and box.tuple.new({ new[1], new[2], math.max(old[3], new[2]) }) or new end