A document store client allows you to interact with a document store in a manner that is similar to a
A document store client has a type parameter which should correspond to a class that is annotated with
To get an instance of a
DocumentStoreClient you do:
DocumentStoreClient<DocumentClass> client = ClientBuilder.getDocumentStoreClient(DocumentClass.class);
In addition the serverless function from which the client is used needs to be annotated with
@UsesDocumentStore(DocumentClass.class), to handle cloud permissions.
In this example
DocumentClass would be replaced with your class that you have annotated with
put(T object)- Inserts object into the document store
delete(T object)- Removes object from the table if it exists
deleteKey(Object keyObject)- Removes the object corresponding to this key from the table. The key of an object is the field that is annotated with
List<T> getAll()- Returns a list of all items in the document store.
T get(Object keyObj)- Returns the object corresponding to the key. Returns null if no object found.
dataModel- The class annotated with
@DocumentStorethat this function will access.
stages- The stages which this function has access to the document store