bin name.
Optional
order: maps.ordermap order.
Optional
persistIndex: booleanif true, persist map index. A map index improves lookup performance, but requires more storage. A map index can be created for a top-level ordered map only. Nested and unordered map indexes are not supported.
Optional
ctx: Contextoptional path to nested map. If not defined, the top-level map is used.
Operation that can be passed to the Client#operate command.
const Aerospike = require('aerospike')
const maps = Aerospike.maps
const key = new Aerospike.Key('test', 'demo', 'mapKey')
// INSERT HOSTNAME AND PORT NUMBER OF AEROSPIKE SERVER NODE HERE!
var config = {
hosts: '192.168.33.10:3000',
// Timeouts disabled, latency dependent on server location. Configure as needed.
policies: {
operate : new Aerospike.OperatePolicy({socketTimeout : 0, totalTimeout : 0})
}
}
Aerospike.connect(config).then(async client => {
let ops = [
maps.create('map', maps.order.KEY_ORDERED, true)
]
let result = await client.operate(key, ops)
console.log(result.bins) // => { map: null }
let record = await client.get(key)
console.log(record.bins) // => { map: {} }
await client.remove(key)
client.close()
})
Creates map create operation.