Hello!
Is there any possibility to set per key TTL in batchWrite? I came to the following code, but it doesn’t work for not existent keys.
const policy = new Aerospike.BatchWritePolicy({
exists: Aerospike.policy.exists.CREATE_OR_REPLACE,
key: Aerospike.policy.key.SEND,
})
const batchRecords = chunk.map(({key, value, ttl}) => ({
type: batchType.BATCH_WRITE,
key: this.makeKey(key),
ops: [
operations.write(DATA_BIN, value),
operations.touch(ttl), // it doesn't work for unexistent keys
],
}))
await client.batchWrite(batchRecords, policy)
I’m using nodejs aerospike client version 5.10.0
Thank you very much!