Package io.stargate.sdk.data
Class CollectionClient
java.lang.Object
io.stargate.sdk.data.CollectionClient
Client for a collection (crud for documents).
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCollectionClient(@NonNull NamespaceClient namespaceClient, @NonNull String collection) Full constructor. -
Method Summary
Modifier and TypeMethodDescriptionCount Document request.countDocuments(Filter jsonFilter) Count Document request.Clear the collection.deleteById(String id) Delete single record from its id.deleteByVector(float[] vector) Delete single record from its vector.deleteMany(DeleteQuery deleteQuery) Delete multiple records from a request.deleteManyChunked(DeleteQuery deleteQuery, int concurrency) Perform a distributed deleted.deleteManyPaged(DeleteQuery deleteQuery) Delete multiple records from a request.deleteOne(DeleteQuery deleteQuery) Delete single record from a request.find(SelectQuery query) Search records with a filter<DOC> Stream<DocumentResult<DOC>> find(SelectQuery pageQuery, DocumentResultMapper<DOC> mapper) Search records with a filter<DOC> Stream<DocumentResult<DOC>> find(SelectQuery query, Class<DOC> clazz) Search records with a filterfindAll()Get all items in a collection.<DOC> Stream<DocumentResult<DOC>> findAll(DocumentResultMapper<DOC> mapper) Find All with Object Mapping.<DOC> Stream<DocumentResult<DOC>> Find All with Object Mapping.<DOC> Optional<DocumentResult<DOC>> findById(@NonNull String id, DocumentResultMapper<DOC> mapper) Find document from its id.<DOC> Optional<DocumentResult<DOC>> Find document from its id.Find document from its id.findOne(SelectQuery query) Find one document matching the query.<DOC> Optional<DocumentResult<DOC>> findOne(SelectQuery query, DocumentResultMapper<DOC> mapper) Find one document matching the query.<DOC> Optional<DocumentResult<DOC>> findOne(SelectQuery query, Class<DOC> clazz) Find one document matching the query.Find one document matching the query.<DOC> Optional<DocumentResult<DOC>> findOne(String query, DocumentResultMapper<DOC> mapper) Find one document matching the query.<DOC> Optional<DocumentResult<DOC>> Find one document matching the query.findOneAndDelete(UpdateQuery query) Find ana delete a record based on a query.findOneAndReplace(UpdateQuery query) Find ana replace a record based on a query,findOneAndUpdate(UpdateQuery query) Find ana update a record based on a query,findOneByVector(float[] vector) Find document from its vector.<DOC> Optional<DocumentResult<DOC>> findOneByVector(float[] vector, DocumentResultMapper<DOC> mapper) Find document from its vector.<DOC> Optional<DocumentResult<DOC>> findOneByVector(float[] vector, Class<DOC> clazz) Find document from its vector.findPage(SelectQuery query) Find documents matching the query.<DOC> Page<DocumentResult<DOC>> findPage(SelectQuery query, DocumentResultMapper<DOC> mapper) Find documents matching the query.<DOC> Page<DocumentResult<DOC>> findPage(SelectQuery query, Class<DOC> clazz) Find documents matching the query.Find one document matching the query.<DOC> Page<DocumentResult<DOC>> findPage(String query, DocumentResultMapper<DOC> mapper) Find documents matching the query.<DOC> Page<DocumentResult<DOC>> Find documents matching the query.findVector(float[] vector, Filter filter, Integer limit) Query builder.findVector(float[] vector, Integer limit) Query builder.findVectorPage(float[] vector, Filter filter, Integer limit, String pagingState) Query builder.<DOC> Page<DocumentResult<DOC>> findVectorPage(float[] vector, Filter filter, Integer limit, String pagingState, DocumentResultMapper<DOC> mapper) Search similarity from the vector (page by 20)<DOC> Page<DocumentResult<DOC>> findVectorPage(float[] vector, Filter filter, Integer limit, String pagingState, Class<DOC> clazz) Search similarity from the vector (page by 20)findVectorPage(SelectQuery query) find Page.final List<JsonDocumentMutationResult> insertMany(JsonDocument... documents) Insert a list of JsonDocument.final <DOC> List<DocumentMutationResult<DOC>> insertMany(Document<DOC>... documents) Insert a list of documents.final List<JsonDocumentMutationResult> insertMany(String json) Try Insert Many with a Stringfinal <DOC> List<DocumentMutationResult<DOC>> insertMany(List<Document<DOC>> documents) Insert Documents: Default is non ordered and no replace.insertManyAsync(JsonDocument... documents) Insert Asynchronously a list of documents.final <DOC> CompletableFuture<List<DocumentMutationResult<DOC>>> insertManyAsync(Document<DOC>... documents) Insert Asynchronously a list of documents.insertManyASync(String json) Try Insert Many with a String Asynchronously.final <DOC> CompletableFuture<List<DocumentMutationResult<DOC>>> insertManyASync(List<Document<DOC>> documents) Try Insert Many with a String Asynchronously.final List<JsonDocumentMutationResult> insertManyChunked(String json, int chunkSize, int concurrency) Low level insertion of multiple recordsfinal <DOC> List<DocumentMutationResult<DOC>> insertManyChunked(List<Document<DOC>> documents, int chunkSize, int concurrency) Low level insertion of multiple recordsinsertManyChunkedASync(String json, int chunkSize, int concurrency) Low level insertion of multiple recordsfinal <DOC> CompletableFuture<List<DocumentMutationResult<DOC>>> insertManyChunkedASync(List<Document<DOC>> documents, int chunkSize, int concurrency) Low level insertion of multiple records asynchronouslyfinal List<JsonDocumentMutationResult> insertManyJsonDocuments(List<JsonDocument> documents) Low level insertion of multiple recordsinsertManyJsonDocumentsASync(List<JsonDocument> documents) Insert Asynchronously a list of documents.final List<JsonDocumentMutationResult> insertManyJsonDocumentsChunked(List<JsonDocument> documents, int chunkSize, int concurrency) Low level insertion of multiple recordsinsertManyJsonDocumentsChunkedASync(List<JsonDocument> documents, int chunkSize, int concurrency) Low level insertion of multiple recordsinsertOne(@NonNull JsonDocument document) Insert with a Json Document (schemaless)final <T> DocumentMutationResult<T> Insert with a Json Document.Insert with a Json Document.insertOneAsync(@NonNull JsonDocument document) Insert with a Json Document (schemaless)insertOneAsync(String json) Insert with a Json Document asynchronouslyfinal <T> CompletableFuture<DocumentMutationResult<T>> insertOneASync(@NonNull Document<T> document) Insert with a Json Document.booleanCheck existence of a document from its id.<DOC> Page<DocumentResult<DOC>> mapPageJsonResultAsPageResult(Page<JsonDocumentResult> pageJson, DocumentResultMapper<DOC> mapper) Map a page of JsonResult to page result.<DOC> Page<DocumentResult<DOC>> mapPageJsonResultAsPageResult(Page<JsonDocumentResult> pageJson, Class<DOC> clazz) Map a page of JsonResult to Page of ResultupdateMany(UpdateQuery query) Update many records.updateOne(UpdateQuery query) Update a single record.final List<JsonDocumentMutationResult> upsertMany(JsonDocument... documents) Insert a list of JsonDocument.final <DOC> List<DocumentMutationResult<DOC>> upsertMany(Document<DOC>... documents) Insert a list of documents.final List<JsonDocumentMutationResult> upsertMany(String json) Upsert of up to 20 documents, expressed as an array within json String.final <DOC> List<DocumentMutationResult<DOC>> upsertMany(List<Document<DOC>> documents) Upsert any items in the collection.upsertManyAsync(JsonDocument... documents) Insert Asynchronously a list of documents.upsertManyASync(String json) Upsert of up to 20 documents Asynchronously, expressed as an array within json String.final <DOC> CompletableFuture<List<DocumentMutationResult<DOC>>> upsertManyASync(List<Document<DOC>> documents) Upsert of up to 20 documents, expressed as key/value documents.final List<JsonDocumentMutationResult> upsertManyChunked(String json, int chunkSize, int concurrency) Low level insertion of multiple recordsfinal <DOC> List<DocumentMutationResult<DOC>> upsertManyChunked(List<Document<DOC>> documents, int chunkSize, int concurrency) Low level insertion of multiple recordsupsertManyChunkedASync(String json, int chunkSize, int concurrency) Low level insertion of multiple recordsfinal <DOC> CompletableFuture<List<DocumentMutationResult<DOC>>> upsertManyChunkedASync(List<Document<DOC>> documents, int chunkSize, int concurrency) Low level insertion of multiple recordsfinal List<JsonDocumentMutationResult> upsertManyJsonDocuments(List<JsonDocument> documents) Upsert of up to 20 documents, expressed as key/value documents.upsertManyJsonDocumentsASync(List<JsonDocument> documents) Upsert of up to 20 documents, expressed as key/value documents.final List<JsonDocumentMutationResult> upsertManyJsonDocumentsChunked(List<JsonDocument> documents, int chunkSize, int concurrency) Low level insertion of multiple recordsupsertManyJsonDocumentsChunkedASync(List<JsonDocument> documents, int chunkSize, int concurrency) Low level insertion of multiple recordsfinal <DOC> CompletableFuture<List<DocumentMutationResult<DOC>>> upsertManyManyAsync(Document<DOC>... documents) Insert Asynchronously a list of documents.upsertOne(@NonNull JsonDocument document) Upsert a document in the collection.<DOC> DocumentMutationResult<DOC> Upsert a document in the collection.Upsert a document in the collection.upsertOneAsync(@NonNull JsonDocument document) Upsert a document in the collection.upsertOneAsync(String json) Upsert a document in the collection.<DOC> CompletableFuture<DocumentMutationResult<DOC>> upsertOneASync(@NonNull Document<DOC> document) Upsert with Asynchronous method.
-
Field Details
-
collectionResource
Resource collection.
-
-
Constructor Details
-
CollectionClient
protected CollectionClient(@NonNull @NonNull NamespaceClient namespaceClient, @NonNull @NonNull String collection) Full constructor.- Parameters:
namespaceClient- client namespace httpcollection- collection identifier
-
-
Method Details
-
insertOne
Insert with a Json Document.- Parameters:
json- json String- Returns:
- document identifier and status
-
insertOneAsync
Insert with a Json Document asynchronously- Parameters:
json- json String- Returns:
- document identifier and status
-
insertOne
Insert with a Json Document (schemaless)- Parameters:
document- current bean- Returns:
- mutation result with status and id
-
insertOneAsync
public final CompletableFuture<JsonDocumentMutationResult> insertOneAsync(@NonNull @NonNull JsonDocument document) Insert with a Json Document (schemaless)- Parameters:
document- current bean- Returns:
- mutation result with status and id
-
insertOne
Insert with a Json Document.- Type Parameters:
T- represent the pojo, payload of document- Parameters:
document- current document- Returns:
- document identifier and status
-
insertOneASync
public final <T> CompletableFuture<DocumentMutationResult<T>> insertOneASync(@NonNull @NonNull Document<T> document) Insert with a Json Document.- Type Parameters:
T- represent the pojo, payload of document- Parameters:
document- current document- Returns:
- document identifier and status
-
upsertOne
Upsert a document in the collection.- Parameters:
json- json to insert- Returns:
- document status and identifier
-
upsertOneAsync
Upsert a document in the collection.- Parameters:
json- json to insert- Returns:
- document status and identifier
-
upsertOne
Upsert a document in the collection.- Parameters:
document- document to insert- Returns:
- document status and identifier
-
upsertOneAsync
public final CompletableFuture<JsonDocumentMutationResult> upsertOneAsync(@NonNull @NonNull JsonDocument document) Upsert a document in the collection.- Parameters:
document- json Document to insert- Returns:
- document status and identifier
-
upsertOne
Upsert a document in the collection.- Type Parameters:
DOC- represent the pojo, payload of document- Parameters:
document- document to insert- Returns:
- document status and identifier
-
upsertOneASync
public <DOC> CompletableFuture<DocumentMutationResult<DOC>> upsertOneASync(@NonNull @NonNull Document<DOC> document) Upsert with Asynchronous method.- Type Parameters:
DOC- current document nature- Parameters:
document- document to insert- Returns:
- completion future
-
insertMany
Try Insert Many with a String- Parameters:
json- current Json- Returns:
- list of status
-
insertManyASync
Try Insert Many with a String Asynchronously.- Parameters:
json- current Json- Returns:
- list of status
-
insertManyJsonDocuments
Low level insertion of multiple records- Parameters:
documents- list of documents- Returns:
- list of ids
-
insertManyJsonDocumentsASync
public final CompletableFuture<List<JsonDocumentMutationResult>> insertManyJsonDocumentsASync(List<JsonDocument> documents) Insert Asynchronously a list of documents.- Parameters:
documents- document list- Returns:
- list of statuses when complete.
-
insertMany
Insert a list of JsonDocument.- Parameters:
documents- document list- Returns:
- list of statuses when complete.
-
insertManyAsync
public final CompletableFuture<List<JsonDocumentMutationResult>> insertManyAsync(JsonDocument... documents) Insert Asynchronously a list of documents.- Parameters:
documents- document list- Returns:
- list of statuses when complete.
-
insertMany
Insert Documents: Default is non ordered and no replace.- Type Parameters:
DOC- represent the pojo, payload of document- Parameters:
documents- list of documents- Returns:
- list of ids
-
insertManyASync
public final <DOC> CompletableFuture<List<DocumentMutationResult<DOC>>> insertManyASync(List<Document<DOC>> documents) Try Insert Many with a String Asynchronously.- Type Parameters:
DOC- represent the pojo, payload of document- Parameters:
documents- list of documents- Returns:
- list of status
-
insertMany
@SafeVarargs public final <DOC> List<DocumentMutationResult<DOC>> insertMany(Document<DOC>... documents) Insert a list of documents.- Type Parameters:
DOC- represent the pojo, payload of document- Parameters:
documents- document list- Returns:
- list of statuses when complete.
-
insertManyAsync
@SafeVarargs public final <DOC> CompletableFuture<List<DocumentMutationResult<DOC>>> insertManyAsync(Document<DOC>... documents) Insert Asynchronously a list of documents.- Type Parameters:
DOC- represent the pojo, payload of document- Parameters:
documents- document list- Returns:
- list of statuses when complete.
-
upsertMany
Upsert of up to 20 documents, expressed as an array within json String.- Parameters:
json- an array of documents within json String.- Returns:
- insertion status for each document (in order of input).
-
upsertManyASync
Upsert of up to 20 documents Asynchronously, expressed as an array within json String.- Parameters:
json- an array of documents within json String.- Returns:
- insertion status for each document (in order of input).
-
upsertManyJsonDocuments
Upsert of up to 20 documents, expressed as key/value documents.- Parameters:
documents- list of documents- Returns:
- list of ids
-
upsertManyJsonDocumentsASync
public final CompletableFuture<List<JsonDocumentMutationResult>> upsertManyJsonDocumentsASync(List<JsonDocument> documents) Upsert of up to 20 documents, expressed as key/value documents.- Parameters:
documents- list of documents- Returns:
- list of ids
-
upsertMany
Insert a list of JsonDocument.- Parameters:
documents- document list- Returns:
- list of statuses when complete.
-
upsertManyAsync
public final CompletableFuture<List<JsonDocumentMutationResult>> upsertManyAsync(JsonDocument... documents) Insert Asynchronously a list of documents.- Parameters:
documents- document list- Returns:
- list of statuses when complete.
-
upsertMany
Upsert any items in the collection.- Type Parameters:
DOC- represent the pojo, payload of document- Parameters:
documents- current collection list- Returns:
- list of statuses
-
upsertManyASync
public final <DOC> CompletableFuture<List<DocumentMutationResult<DOC>>> upsertManyASync(List<Document<DOC>> documents) Upsert of up to 20 documents, expressed as key/value documents.- Type Parameters:
DOC- represent the pojo, payload of document- Parameters:
documents- list of documents- Returns:
- list of ids
-
upsertMany
@SafeVarargs public final <DOC> List<DocumentMutationResult<DOC>> upsertMany(Document<DOC>... documents) Insert a list of documents.- Type Parameters:
DOC- represent the pojo, payload of document- Parameters:
documents- document list- Returns:
- list of statuses when complete.
-
upsertManyManyAsync
@SafeVarargs public final <DOC> CompletableFuture<List<DocumentMutationResult<DOC>>> upsertManyManyAsync(Document<DOC>... documents) Insert Asynchronously a list of documents.- Type Parameters:
DOC- represent the pojo, payload of document- Parameters:
documents- document list- Returns:
- list of statuses when complete.
-
insertManyChunked
public final List<JsonDocumentMutationResult> insertManyChunked(String json, int chunkSize, int concurrency) Low level insertion of multiple records- Parameters:
json- Json StringchunkSize- size of the blockconcurrency- number of blocks in parallel- Returns:
- list of ids
-
insertManyChunkedASync
public final CompletableFuture<List<JsonDocumentMutationResult>> insertManyChunkedASync(String json, int chunkSize, int concurrency) Low level insertion of multiple records- Parameters:
json- Json StringchunkSize- size of the blockconcurrency- number of blocks in parallel- Returns:
- list of ids
-
insertManyJsonDocumentsChunked
public final List<JsonDocumentMutationResult> insertManyJsonDocumentsChunked(List<JsonDocument> documents, int chunkSize, int concurrency) Low level insertion of multiple records- Parameters:
documents- list of documentschunkSize- size of the blockconcurrency- number of blocks in parallel- Returns:
- list of ids
-
insertManyJsonDocumentsChunkedASync
public final CompletableFuture<List<JsonDocumentMutationResult>> insertManyJsonDocumentsChunkedASync(List<JsonDocument> documents, int chunkSize, int concurrency) Low level insertion of multiple records- Parameters:
documents- list of documentschunkSize- size of the blockconcurrency- number of blocks in parallel- Returns:
- list of ids
-
insertManyChunked
public final <DOC> List<DocumentMutationResult<DOC>> insertManyChunked(List<Document<DOC>> documents, int chunkSize, int concurrency) Low level insertion of multiple records- Type Parameters:
DOC- represent the pojo, payload of document- Parameters:
documents- list of documentschunkSize- size of the blockconcurrency- number of blocks in parallel- Returns:
- list of ids
-
insertManyChunkedASync
public final <DOC> CompletableFuture<List<DocumentMutationResult<DOC>>> insertManyChunkedASync(List<Document<DOC>> documents, int chunkSize, int concurrency) Low level insertion of multiple records asynchronously- Type Parameters:
DOC- represent the pojo, payload of document- Parameters:
documents- list of documentschunkSize- size of the blockconcurrency- number of blocks in parallel- Returns:
- list of ids
-
upsertManyChunked
public final List<JsonDocumentMutationResult> upsertManyChunked(String json, int chunkSize, int concurrency) Low level insertion of multiple records- Parameters:
json- Json StringchunkSize- size of the blockconcurrency- number of blocks in parallel- Returns:
- list of ids
-
upsertManyChunkedASync
public final CompletableFuture<List<JsonDocumentMutationResult>> upsertManyChunkedASync(String json, int chunkSize, int concurrency) Low level insertion of multiple records- Parameters:
json- Json StringchunkSize- size of the blockconcurrency- number of blocks in parallel- Returns:
- list of ids
-
upsertManyJsonDocumentsChunked
public final List<JsonDocumentMutationResult> upsertManyJsonDocumentsChunked(List<JsonDocument> documents, int chunkSize, int concurrency) Low level insertion of multiple records- Parameters:
documents- list of documentschunkSize- size of the blockconcurrency- number of blocks in parallel- Returns:
- list of ids
-
upsertManyJsonDocumentsChunkedASync
public final CompletableFuture<List<JsonDocumentMutationResult>> upsertManyJsonDocumentsChunkedASync(List<JsonDocument> documents, int chunkSize, int concurrency) Low level insertion of multiple records- Parameters:
documents- list of documentschunkSize- size of the blockconcurrency- number of blocks in parallel- Returns:
- list of ids
-
upsertManyChunked
public final <DOC> List<DocumentMutationResult<DOC>> upsertManyChunked(List<Document<DOC>> documents, int chunkSize, int concurrency) Low level insertion of multiple records- Type Parameters:
DOC- represent the pojo, payload of document- Parameters:
documents- list of documentschunkSize- size of the blockconcurrency- concurrency- Returns:
- list of ids
-
upsertManyChunkedASync
public final <DOC> CompletableFuture<List<DocumentMutationResult<DOC>>> upsertManyChunkedASync(List<Document<DOC>> documents, int chunkSize, int concurrency) Low level insertion of multiple records- Type Parameters:
DOC- represent the pojo, payload of document- Parameters:
documents- list of documentschunkSize- size of the blockconcurrency- concurrency- Returns:
- list of ids
-
countDocuments
Count Document request.- Returns:
- number of document.
-
countDocuments
Count Document request.- Parameters:
jsonFilter- request to filter for count- Returns:
- number of document.
-
isDocumentExists
Check existence of a document from its id. Projection to make it as light as possible.- Parameters:
id- document identifier- Returns:
- existence status
-
findOne
Find one document matching the query.- Parameters:
query- query documents and vector- Returns:
- result if exists
-
findOne
Find one document matching the query.- Parameters:
rawJsonQuery- execute a direct json Query- Returns:
- result if exists
-
findOne
Find one document matching the query.- Type Parameters:
DOC- class to be marshalled- Parameters:
query- query documents and vectorclazz- class of the document- Returns:
- result if exists
-
findOne
Find one document matching the query.- Type Parameters:
DOC- class to be marshalled- Parameters:
query- query documents and vectormapper- convert a json into expected pojo- Returns:
- result if exists
-
findOne
Find one document matching the query.- Type Parameters:
DOC- class to be marshalled- Parameters:
query- query documents and vectorclazz- class of the document- Returns:
- result if exists
-
findOne
public <DOC> Optional<DocumentResult<DOC>> findOne(SelectQuery query, DocumentResultMapper<DOC> mapper) Find one document matching the query.- Type Parameters:
DOC- class to be marshalled- Parameters:
query- query documents and vectormapper- convert a json into expected pojo- Returns:
- result if exists
-
findById
Find document from its id.- Parameters:
id- document identifier- Returns:
- document
-
findById
Find document from its id.- Type Parameters:
DOC- class to be marshalled- Parameters:
id- document identifierclazz- class for target pojo- Returns:
- document
-
findById
public <DOC> Optional<DocumentResult<DOC>> findById(@NonNull @NonNull String id, DocumentResultMapper<DOC> mapper) Find document from its id.- Type Parameters:
DOC- class to be marshalled- Parameters:
id- document identifiermapper- convert a json into expected pojo- Returns:
- document
-
findOneByVector
Find document from its vector.- Parameters:
vector- document vector- Returns:
- document
-
findOneByVector
Find document from its vector.- Type Parameters:
DOC- class to be marshalled- Parameters:
vector- document vectorclazz- class for target pojo- Returns:
- document
-
findOneByVector
public <DOC> Optional<DocumentResult<DOC>> findOneByVector(float[] vector, DocumentResultMapper<DOC> mapper) Find document from its vector.- Type Parameters:
DOC- class to be marshalled- Parameters:
vector- document vectormapper- convert a json into expected pojo- Returns:
- document
-
find
Search records with a filter- Parameters:
query- filter- Returns:
- all items
-
findPage
Find documents matching the query.- Parameters:
query- current query- Returns:
- page of results
-
findPage
Find one document matching the query.- Parameters:
query- execute a direct json Query- Returns:
- result if exists
-
findVector
Query builder.- Parameters:
vector- vector embeddingslimit- limit for output- Returns:
- result page
-
findVector
Query builder.- Parameters:
vector- vector embeddingsfilter- metadata filterlimit- limit for output- Returns:
- result page
-
findVectorPage
find Page.- Parameters:
query- return query Page- Returns:
- page of results
-
findVectorPage
public Page<JsonDocumentResult> findVectorPage(float[] vector, Filter filter, Integer limit, String pagingState) Query builder.- Parameters:
vector- vector embeddingsfilter- metadata filterlimit- limitpagingState- paging state- Returns:
- result page
-
findVectorPage
public <DOC> Page<DocumentResult<DOC>> findVectorPage(float[] vector, Filter filter, Integer limit, String pagingState, Class<DOC> clazz) Search similarity from the vector (page by 20)- Type Parameters:
DOC- type of document- Parameters:
vector- vector embeddingsfilter- metadata filterlimit- limitpagingState- paging stateclazz- current class.- Returns:
- page of results
-
findVectorPage
public <DOC> Page<DocumentResult<DOC>> findVectorPage(float[] vector, Filter filter, Integer limit, String pagingState, DocumentResultMapper<DOC> mapper) Search similarity from the vector (page by 20)- Type Parameters:
DOC- type of document- Parameters:
vector- vector embeddingsfilter- metadata filterlimit- limitpagingState- paging statemapper- result mapper- Returns:
- page of results
-
find
Search records with a filter- Type Parameters:
DOC- class to be marshalled- Parameters:
query- filterclazz- class for target pojo- Returns:
- all items
-
find
public <DOC> Stream<DocumentResult<DOC>> find(SelectQuery pageQuery, DocumentResultMapper<DOC> mapper) Search records with a filter- Type Parameters:
DOC- class to be marshalled- Parameters:
pageQuery- filtermapper- convert a json into expected pojo- Returns:
- all items
-
findAll
Get all items in a collection.- Returns:
- all items
-
findAll
Find All with Object Mapping.- Type Parameters:
DOC- class to be marshalled- Parameters:
clazz- class to be used- Returns:
- stream of results
-
findAll
Find All with Object Mapping.- Type Parameters:
DOC- class to be marshalled- Parameters:
mapper- convert a json into expected pojo- Returns:
- stream of results
-
findPage
Find documents matching the query.- Type Parameters:
DOC- class to be marshalled- Parameters:
query- current queryclazz- class for target pojo- Returns:
- page of results
-
findPage
Find documents matching the query.- Type Parameters:
DOC- class to be marshalled- Parameters:
query- current queryclazz- class for target pojo- Returns:
- page of results
-
findPage
public <DOC> Page<DocumentResult<DOC>> findPage(SelectQuery query, DocumentResultMapper<DOC> mapper) Find documents matching the query.- Type Parameters:
DOC- class to be marshalled- Parameters:
query- current querymapper- mapper to convert into target pojo- Returns:
- page of results
-
findPage
Find documents matching the query.- Type Parameters:
DOC- class to be marshalled- Parameters:
query- current querymapper- mapper to convert into target pojo- Returns:
- page of results
-
mapPageJsonResultAsPageResult
public <DOC> Page<DocumentResult<DOC>> mapPageJsonResultAsPageResult(Page<JsonDocumentResult> pageJson, Class<DOC> clazz) Map a page of JsonResult to Page of Result- Type Parameters:
DOC- type of object im page- Parameters:
pageJson- current pageclazz- target beam- Returns:
- new page
-
mapPageJsonResultAsPageResult
public <DOC> Page<DocumentResult<DOC>> mapPageJsonResultAsPageResult(Page<JsonDocumentResult> pageJson, DocumentResultMapper<DOC> mapper) Map a page of JsonResult to page result.- Type Parameters:
DOC- type pf object im page- Parameters:
pageJson- current pagemapper- mapper for the class- Returns:
- new page
-
deleteOne
Delete single record from a request.- Parameters:
deleteQuery- delete query- Returns:
- number of deleted records and status
-
deleteById
Delete single record from its id.- Parameters:
id- id- Returns:
- number of deleted records
-
deleteByVector
Delete single record from its vector.- Parameters:
vector- vector- Returns:
- number of deleted records
-
deleteMany
Delete multiple records from a request.- Parameters:
deleteQuery- delete query- Returns:
- number of deleted records
-
deleteManyChunked
Perform a distributed deleted.- Parameters:
deleteQuery- deleting queryconcurrency- concrrency number- Returns:
- the delete result
-
deleteManyPaged
Delete multiple records from a request.- Parameters:
deleteQuery- delete query- Returns:
- number of deleted records
-
deleteAll
Clear the collection.- Returns:
- number of items deleted
-
findOneAndUpdate
Find ana update a record based on a query,- Parameters:
query- query to find the record- Returns:
- result of the update
-
findOneAndReplace
Find ana replace a record based on a query,- Parameters:
query- query to find the record- Returns:
- result of the update
-
findOneAndDelete
Find ana delete a record based on a query.- Parameters:
query- query to find the record- Returns:
- result of the update
-
updateOne
Update a single record.- Parameters:
query- query to find the record- Returns:
- update status
-
updateMany
Update many records.- Parameters:
query- query to find the record- Returns:
- update status
-