Interface ReactiveCosmosOperations
- All Known Implementing Classes:
ReactiveCosmosTemplate
public interface ReactiveCosmosOperations
Operation class of reactive cosmos
-
Method Summary
Modifier and TypeMethodDescriptionCountcount
(CosmosQuery query, String containerName) CountCountMono
<com.azure.cosmos.models.CosmosContainerResponse> createContainerIfNotExists
(CosmosEntityInformation<?, ?> information) Creates a container if it doesn't already exist<T> Flux
<T> delete
(CosmosQuery query, Class<T> domainType, String containerName) Delete items matching queryDelete all items in a container.deleteById
(String containerName, Object id, com.azure.cosmos.models.PartitionKey partitionKey) Delete an item by idvoid
deleteContainer
(String containerName) Delete containerdeleteEntities
(CosmosEntityInformation<T, ?> entityInformation, Iterable<S> entities) Delete all items with bulk.deleteEntities
(CosmosEntityInformation<T, ?> entityInformation, Flux<S> entities) Delete all items with bulk.deleteEntity
(String containerName, T entity) Delete using entityexists
(CosmosQuery query, Class<?> domainType, String containerName) ExistsexistsById
(Object id, Class<?> domainType, String containerName) Exists<T> Flux
<T> find
(CosmosQuery query, Class<T> domainType, String containerName) Find items<T> Flux
<T> Find all items in a given container with partition key<T> Flux
<T> Find all items in a given container<T> Flux
<T> Find all items in a given container<T> Mono
<T> Find by id<T> Mono
<T> Find by id<T> Mono
<T> Find by idgetContainerName
(Class<?> domainType) Get container nameMono
<com.azure.cosmos.models.CosmosContainerProperties> getContainerProperties
(String containerName) Get properties for specified containerTo get converter<T> Mono
<T> Insert<T> Mono
<T> Insert<T> Mono
<T> insert
(T objectToSave, com.azure.cosmos.models.PartitionKey partitionKey) Insert<S extends T,
T>
Flux<S> insertAll
(CosmosEntityInformation<T, ?> entityInformation, Iterable<S> entities) Insert all items with bulk.<S extends T,
T>
Flux<S> insertAll
(CosmosEntityInformation<T, ?> entityInformation, Flux<S> entities) Insert all items with bulk.<T> Mono
<T> patch
(Object id, com.azure.cosmos.models.PartitionKey partitionKey, Class<T> domainType, com.azure.cosmos.models.CosmosPatchOperations patchOperations) patches item<T> Mono
<T> patch
(Object id, com.azure.cosmos.models.PartitionKey partitionKey, Class<T> domainType, com.azure.cosmos.models.CosmosPatchOperations patchOperations, com.azure.cosmos.models.CosmosPatchItemRequestOptions options) patches itemMono
<com.azure.cosmos.models.CosmosContainerProperties> replaceContainerProperties
(String containerName, com.azure.cosmos.models.CosmosContainerProperties properties) Replace container properties for the specified container<T> Flux
<T> Run the query.<T> Flux
<T> runQuery
(com.azure.cosmos.models.SqlQuerySpec querySpec, org.springframework.data.domain.Sort sort, Class<?> domainType, Class<T> returnType) Run the query.Sum<T> Mono
<T> Upsert an item to container with partition key<T> Mono
<T> upsert
(T object) Upsert an item with partition key
-
Method Details
-
getContainerName
Get container name- Parameters:
domainType
- the domainType- Returns:
- container name
-
createContainerIfNotExists
Mono<com.azure.cosmos.models.CosmosContainerResponse> createContainerIfNotExists(CosmosEntityInformation<?, ?> information) Creates a container if it doesn't already exist- Parameters:
information
- the CosmosEntityInformation- Returns:
- Mono of CosmosContainerResponse
-
getContainerProperties
Mono<com.azure.cosmos.models.CosmosContainerProperties> getContainerProperties(String containerName) Get properties for specified container- Parameters:
containerName
- String- Returns:
- CosmosContainerProperties
-
replaceContainerProperties
Mono<com.azure.cosmos.models.CosmosContainerProperties> replaceContainerProperties(String containerName, com.azure.cosmos.models.CosmosContainerProperties properties) Replace container properties for the specified container- Parameters:
containerName
- Stringproperties
- CosmosContainerProperties- Returns:
- CosmosContainerProperties
-
findAll
Find all items in a given container- Type Parameters:
T
- type of domainType- Parameters:
containerName
- the containerNamedomainType
- the domainType- Returns:
- Flux of results
-
findAll
Find all items in a given container- Type Parameters:
T
- type of domainType- Parameters:
domainType
- the domainType- Returns:
- Flux of results
-
findAll
Find all items in a given container with partition key- Type Parameters:
T
- type of domainType- Parameters:
partitionKey
- partition KeydomainType
- the domainType- Returns:
- Flux of results
-
findById
Find by id- Type Parameters:
T
- type of domainType- Parameters:
id
- the iddomainType
- the domainType- Returns:
- Mono of result
-
findById
Find by id- Type Parameters:
T
- type of domainType- Parameters:
containerName
- the containernameid
- the iddomainType
- type class- Returns:
- Mono of result
-
findById
<T> Mono<T> findById(Object id, Class<T> domainType, com.azure.cosmos.models.PartitionKey partitionKey) Find by id- Type Parameters:
T
- type of domainType- Parameters:
id
- the iddomainType
- type classpartitionKey
- partition Key- Returns:
- Mono of result
-
insert
Insert- Type Parameters:
T
- type of inserted objectToSave- Parameters:
objectToSave
- the object to savepartitionKey
- the partition key- Returns:
- Mono of result
-
insert
<T> Mono<T> insert(String containerName, T objectToSave, com.azure.cosmos.models.PartitionKey partitionKey) Insert- Type Parameters:
T
- type of inserted objectToSave- Parameters:
containerName
- the container nameobjectToSave
- the object to savepartitionKey
- the partition key- Returns:
- Mono of result
-
insert
Insert- Type Parameters:
T
- type class of domain type- Parameters:
containerName
- must not be nullobjectToSave
- must not be null- Returns:
- Mono of result
-
insertAll
<S extends T,T> Flux<S> insertAll(CosmosEntityInformation<T, ?> entityInformation, Iterable<S> entities) Insert all items with bulk.- Type Parameters:
S
- type class of domain typeT
- type class of domain type- Parameters:
entityInformation
- must not be nullentities
- must not be null- Returns:
- Flux of result
-
insertAll
<S extends T,T> Flux<S> insertAll(CosmosEntityInformation<T, ?> entityInformation, Flux<S> entities) Insert all items with bulk.- Type Parameters:
S
- type class of domain typeT
- type class of domain type- Parameters:
entityInformation
- must not be nullentities
- must not be null- Returns:
- Flux of result
-
patch
<T> Mono<T> patch(Object id, com.azure.cosmos.models.PartitionKey partitionKey, Class<T> domainType, com.azure.cosmos.models.CosmosPatchOperations patchOperations) patches item- Type Parameters:
T
- type class of domain type- Parameters:
id
- must not be nullpartitionKey
- must not be nulldomainType
- must not be nullpatchOperations
- must not be null, max operations is 10- Returns:
- the patched item
-
patch
<T> Mono<T> patch(Object id, com.azure.cosmos.models.PartitionKey partitionKey, Class<T> domainType, com.azure.cosmos.models.CosmosPatchOperations patchOperations, com.azure.cosmos.models.CosmosPatchItemRequestOptions options) patches item- Type Parameters:
T
- type class of domain type- Parameters:
id
- must not be nullpartitionKey
- must not be nulldomainType
- must not be nullpatchOperations
- must not be null, max operations is 10options
- Optional CosmosPatchItemRequestOptions, e.g. options.setFilterPredicate("FROM products p WHERE p.used = false");- Returns:
- Mono with the patched item
-
upsert
Upsert an item with partition key- Type Parameters:
T
- type class of object- Parameters:
object
- the object to upsert- Returns:
- Mono of result
-
upsert
Upsert an item to container with partition key- Type Parameters:
T
- type class of object- Parameters:
containerName
- the container nameobject
- the object to save- Returns:
- Mono of result
-
deleteById
Mono<Void> deleteById(String containerName, Object id, com.azure.cosmos.models.PartitionKey partitionKey) Delete an item by id- Parameters:
containerName
- the container nameid
- the idpartitionKey
- the partition key- Returns:
- void Mono
-
deleteEntity
Delete using entity- Type Parameters:
T
- type class of domain type- Parameters:
containerName
- the container nameentity
- the entity object- Returns:
- void Mono
-
deleteEntities
<S extends T,T> Mono<Void> deleteEntities(CosmosEntityInformation<T, ?> entityInformation, Iterable<S> entities) Delete all items with bulk.- Type Parameters:
S
- type class of domain typeT
- type class of domain type- Parameters:
entityInformation
- must not be nullentities
- must not be null- Returns:
- void Mono
-
deleteEntities
<S extends T,T> Mono<Void> deleteEntities(CosmosEntityInformation<T, ?> entityInformation, Flux<S> entities) Delete all items with bulk.- Type Parameters:
S
- type class of domain typeT
- type class of domain type- Parameters:
entityInformation
- must not be nullentities
- must not be null- Returns:
- void Mono
-
deleteAll
Delete all items in a container. Uses bulk if possible.- Parameters:
containerName
- the container namedomainType
- the domainType- Returns:
- void Mono
-
deleteContainer
Delete container- Parameters:
containerName
- the container name
-
delete
Delete items matching query- Type Parameters:
T
- type class of domainType- Parameters:
query
- the document querydomainType
- type classcontainerName
- the container name- Returns:
- Flux of results
-
find
Find items- Type Parameters:
T
- type class of domainType- Parameters:
query
- the document querydomainType
- type classcontainerName
- the container name- Returns:
- Flux of results
-
exists
Exists- Parameters:
query
- the document querydomainType
- type classcontainerName
- the container name- Returns:
- Mono of result
-
existsById
Exists- Parameters:
id
- the iddomainType
- type classcontainerName
- the container name- Returns:
- Mono of result
-
count
Count- Parameters:
containerName
- the container name- Returns:
- Mono of result
-
count
Count- Parameters:
query
- the document querycontainerName
- the container name- Returns:
- Mono of result
-
count
Count- Parameters:
querySpec
- the document query speccontainerName
- the container name- Returns:
- Mono of result
-
sum
Sum- Parameters:
querySpec
- the document query speccontainerName
- the container name- Returns:
- sum result
-
getConverter
MappingCosmosConverter getConverter()To get converter- Returns:
- MappingCosmosConverter
-
runQuery
<T> Flux<T> runQuery(com.azure.cosmos.models.SqlQuerySpec querySpec, Class<?> domainType, Class<T> returnType) Run the query.- Type Parameters:
T
- the type parameter- Parameters:
querySpec
- the query specdomainType
- the domain typereturnType
- the return type- Returns:
- the flux
-
runQuery
<T> Flux<T> runQuery(com.azure.cosmos.models.SqlQuerySpec querySpec, org.springframework.data.domain.Sort sort, Class<?> domainType, Class<T> returnType) Run the query.- Type Parameters:
T
- the type parameter- Parameters:
querySpec
- the query specsort
- the sort orderdomainType
- the domain typereturnType
- the return type- Returns:
- the flux
-