Index
Manage the holder's list of credentials
Last updated
Was this helpful?
Manage the holder's list of credentials
Last updated
Was this helpful?
The Index Control Plane is the interface responsible for managing operations on the holder's personal index.
The Index Plane implements eight methods: get
, (optionally) getPage
, (optionally) getCount
, add
, addMany
, update
, remove
, and removeAll.
When there are a lot of credentials stored in the index for a given query, it can be useful to paginate your queries rather than request all of them at once. That is what getPage
is for! This call will return an object of the following shape:
Using the hasMore
and cursor
fields, you can determine if you should request the next page, as well as how to request the next page. The below example shows a simple way to request all available pages:
Sometimes, it can be useful for an app to display the total number of records for a given query without wanting to actual grab every credential for that query. This is where getCount
comes in handy!
The add
method takes in a CredentialRecord
and adds it to the holder's personal index.
The optional addMany
method takes in an array of CredentialRecord
s and adds them to the holder's personal index.
The update
method takes in an ID and an update object and updates a CredentialRecord
in the holder's personal index.
The remove
method takes in an ID and removes the CredentialRecord
with the corresponding ID from the holder's personal index.
The optional removeAll
method flushes all CredentialRecord
s from the holder's personal index.
The get
method takes in a Mongo-style query and returns a list of CredentialRecords
, which are primarily an ID, a , and some metadata.
If the LearnCard also implements the , then this method will automatically be cached!
If the LearnCard also implements the , then this Plane will automatically be cached!