Companion code for the Aerospike Summit 2022 roadshow presentation "Building with Secondary Indexes and Document API in Aerospike Database 6".
This demonstration includes optional use of the Aerospike gateway's
Document API (AKA the 'REST client'). If you would like to run
document-api-example.py
you need to do get the following:
- Aerospike Database 6.0
- Python 3.7+
- Aerospike Python Client >= 7.0.0
- The "REST client" from the download page
- The Swagger generated Python client for the REST (a git submodule)
pip install aerospike
git submodule init # fetches the AerospikeRestApi client source
cd aerospike-python-rest
python setup.py build
python setup.py install
The presentation mentions which scripts are being run for each slide. The sequence is as follows:
fill.py
to fill the database with sample datapi-query.py
to demonstrate partitioned PI queries (FKA scans)pi-query-filter-exp.py
to demonstrate the use of filter expressiosn with a PI querypi-query-paginated.py
to demonstrate query paginationdocument-api-example.py
to show an alternative way to add documentssi-query-filter-exp.py
combining an SI query with a filter expressionsi-query.py
demonstrates an SI query with no filter expression
All the scripts support the following options:
optional arguments:
--help Displays this message.
-U <USERNAME>, --username <USERNAME>
Username to connect to database.
-P <PASSWORD>, --password <PASSWORD>
Password to connect to database.
-h <ADDRESS>, --host <ADDRESS>
Address of Aerospike server.
-p <PORT>, --port <PORT>
Port of the Aerospike server.
-n <NS>, --namespace <NS>
Namespace name to use
-s <SET>, --set <SET>
Set name to use.
--services-alternate Use services alternate