Key not found in latest version


When the aerospike’s client library has been updated to the latest, the following errors have appeared in several places.

  1. Why did this change come in? ( refs: CHANGELOG
Key not found

I expect that if there is no key, a record will be created with that key,

  1. How is the best way to handle it?

my code is like below (for example).

    // read operations
    op := as.MapGetByKeyOp(idx.BinName, idx.CampaignID, as.MapReturnType.VALUE)
    wp := as.NewWritePolicy(0, TTLDontUpdate)
    record, err: = db.Aerospike().Operate(wp, key, op)
    if err! = nil {
        return err
    // build  `value`
   value := ....

    // write operations
    mp := as.DefaultMapPolicy()
    op = as.MapPutOp (mp, idx.BinName, idx.CampaignID, value)

That change is a long list of overdue changes to bring the client up to date with some user requests and server changes.

What do you mean by create a record if it does not exist? A read request cannot create a record, since it does not know what bins to put in the record.


You’re right. it was my misunderstanding. i will just create a new record if the key doesnt exist.

Thank you for your reply. It’s been solved.