Articles in this section

FAQ: Why isn't the Primary Key returned when I read a record?

Detail

When doing a single-record or batch read through a client or aql using the digest, the primary key is not returned even though the record was written with sendKey=true, as_policy_key=AS_POLICY_KEY_SEND, or equivalent.

Answer

send_key was implemented to allow confirmation that the key matches on a read (if the primary key is sent as well as the digest on a read, it will return an error if they don't match) to guard against the already infinitesimal chance of a RIPE-MD160 collision. The stored primary key is better considered as a checksum that happens to be the same bytes as the primary key generated by the client. To be able to retrieve the primary key from a record without knowing that key in advance, the key needs to be explicitly stored in a bin.

Notes

Primary and secondary index queries do return the stored key for checking by the client application, as primary keys cannot be sent for those transactions.

Applies To Earliest Version

Pre 4.9

Applies To Latest Version

Current Version
Was this article helpful?
0 out of 0 found this helpful