SELECT * FROM . returns list of records(one row per key), but only shows the record’s content, how to get the primary key also?
For example:
INSERT INTO test.someset(PK, bin) VALUES (‘primary_key_value’, ‘bin_value’)
SELECT * FROM test.someset returns only ‘bin_value’, how to get ‘primary_key_value’ also in the SELECT query?
±------------+
| bin |
±------------+
| “bin_value” |
±------------+
option. When you create records via AQL after setting KEY_SEND true, (default is false), the primary key is stored as a BIN and then you can retrieve it via the record.
If at the time of record creation you don’t set the key policy to SEND the KEY, Aerospike by default stores only the hash of the setname+key concatenation, called the DIGEST, which is what the Aerospike Client sends to Aerospike. So, internally, Aerospike does not store your key in any form by default.
You can see the DIGEST in Base64 in AQL by setting:
SET OUTPUT JSON
SET RECORD_PRINT_METADATA TRUE