How to get single record from table.
Can anyone help me, I'm trying to get single row (record) from table but get_table_rows api return all the record. how can I get single record based on some condition match from table.
-l will limit the record but my requirement is to get a single record from table based on condition match. for example - tableData = { rows: [{'age': 20, 'name': 'rahul''}, {'age': 18, 'name': 'prachi'}, {'age': 22, 'name': 'ram'}] }; from this table how can i get only "prachi" row record. Can anyone please elaborate.
Set limit to 1
Since multi_index tables may not have string indexes, you will need to provide another field on which to search. One possible secondary index type is ripemd160. You may store the ripemd160 hash of your 'name' field as a secondary index and use that value as an argument to --lower-bound and --upper-bound. Together with the --index and --key-type arguments, you can find what you are searching for using get_table_rows.