Interface ReactiveCosmosOperations
-
- All Known Implementing Classes:
ReactiveCosmosTemplate
public interface ReactiveCosmosOperationsOperation class of reactive cosmos
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Mono<Long>count(SqlQuerySpec querySpec, String containerName)CountMono<Long>count(CosmosQuery query, String containerName)CountMono<Long>count(String containerName)CountMono<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 queryMono<Void>deleteAll(String containerName, Class<?> domainType)Delete all items in a containerMono<Void>deleteById(String containerName, Object id, PartitionKey partitionKey)Delete an item by idvoiddeleteContainer(String containerName)Delete container<T> Mono<Void>deleteEntity(String containerName, T entity)Delete using entityMono<Boolean>exists(CosmosQuery query, Class<?> domainType, String containerName)ExistsMono<Boolean>existsById(Object id, Class<?> domainType, String containerName)Exists<T> Flux<T>find(CosmosQuery query, Class<T> domainType, String containerName)Find items<T> Flux<T>findAll(PartitionKey partitionKey, Class<T> domainType)Find all items in a given container with partition key<T> Flux<T>findAll(Class<T> domainType)Find all items in a given container<T> Flux<T>findAll(String containerName, Class<T> domainType)Find all items in a given container<T> Mono<T>findById(Object id, Class<T> domainType)Find by id<T> Mono<T>findById(Object id, Class<T> domainType, PartitionKey partitionKey)Find by id<T> Mono<T>findById(String containerName, Object id, Class<T> domainType)Find by idStringgetContainerName(Class<?> domainType)Get container nameMono<CosmosContainerProperties>getContainerProperties(String containerName)Get properties for specified containerMappingCosmosConvertergetConverter()To get converter<T> Mono<T>insert(String containerName, Object objectToSave, PartitionKey partitionKey)Insert<T> Mono<T>insert(String containerName, T objectToSave)Insert<T> Mono<T>insert(T objectToSave, PartitionKey partitionKey)InsertMono<CosmosContainerProperties>replaceContainerProperties(String containerName, CosmosContainerProperties properties)Replace container properties for the specified container<T> Flux<T>runQuery(SqlQuerySpec querySpec, Class<?> domainType, Class<T> returnType)Run the query.<T> Flux<T>runQuery(SqlQuerySpec querySpec, org.springframework.data.domain.Sort sort, Class<?> domainType, Class<T> returnType)Run the query.<T> Mono<T>upsert(String containerName, T object)Upsert an item to container with partition key<T> Mono<T>upsert(T object)Upsert an item with partition key
-
-
-
Method Detail
-
getContainerName
String getContainerName(Class<?> domainType)
Get container name- Parameters:
domainType- the domainType- Returns:
- container name
-
createContainerIfNotExists
Mono<CosmosContainerResponse> createContainerIfNotExists(CosmosEntityInformation<?,?> information)
Creates a container if it doesn't already exist- Parameters:
information- the CosmosEntityInformation- Returns:
- Mono of CosmosContainerResponse
-
getContainerProperties
Mono<CosmosContainerProperties> getContainerProperties(String containerName)
Get properties for specified container- Parameters:
containerName- String- Returns:
- CosmosContainerProperties
-
replaceContainerProperties
Mono<CosmosContainerProperties> replaceContainerProperties(String containerName, CosmosContainerProperties properties)
Replace container properties for the specified container- Parameters:
containerName- Stringproperties- CosmosContainerProperties- Returns:
- CosmosContainerProperties
-
findAll
<T> Flux<T> findAll(String containerName, Class<T> domainType)
Find all items in a given container- Type Parameters:
T- type of domainType- Parameters:
containerName- the containerNamedomainType- the domainType- Returns:
- Flux of results
-
findAll
<T> Flux<T> findAll(Class<T> domainType)
Find all items in a given container- Type Parameters:
T- type of domainType- Parameters:
domainType- the domainType- Returns:
- Flux of results
-
findAll
<T> Flux<T> findAll(PartitionKey partitionKey, Class<T> domainType)
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
<T> Mono<T> findById(Object id, Class<T> domainType)
Find by id- Type Parameters:
T- type of domainType- Parameters:
id- the iddomainType- the domainType- Returns:
- Mono of result
-
findById
<T> Mono<T> findById(String containerName, Object id, Class<T> domainType)
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, PartitionKey partitionKey)
Find by id- Type Parameters:
T- type of domainType- Parameters:
id- the iddomainType- type classpartitionKey- partition Key- Returns:
- Mono of result
-
insert
<T> Mono<T> insert(T objectToSave, PartitionKey partitionKey)
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, Object objectToSave, 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
<T> Mono<T> insert(String containerName, T objectToSave)
Insert- Type Parameters:
T- type class of domain type- Parameters:
containerName- must not be nullobjectToSave- must not be null- Returns:
- Mono of result
-
upsert
<T> Mono<T> upsert(T object)
Upsert an item with partition key- Type Parameters:
T- type class of object- Parameters:
object- the object to upsert- Returns:
- Mono of result
-
upsert
<T> Mono<T> upsert(String containerName, T object)
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, PartitionKey partitionKey)
Delete an item by id- Parameters:
containerName- the container nameid- the idpartitionKey- the partition key- Returns:
- void Mono
-
deleteEntity
<T> Mono<Void> deleteEntity(String containerName, T entity)
Delete using entity- Type Parameters:
T- type class of domain type- Parameters:
containerName- the container nameentity- the entity object- Returns:
- void Mono
-
deleteAll
Mono<Void> deleteAll(String containerName, Class<?> domainType)
Delete all items in a container- Parameters:
containerName- the container namedomainType- the domainType- Returns:
- void Mono
-
deleteContainer
void deleteContainer(String containerName)
Delete container- Parameters:
containerName- the container name
-
delete
<T> Flux<T> delete(CosmosQuery query, Class<T> domainType, String containerName)
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
<T> Flux<T> find(CosmosQuery query, Class<T> domainType, String containerName)
Find items- Type Parameters:
T- type class of domainType- Parameters:
query- the document querydomainType- type classcontainerName- the container name- Returns:
- Flux of results
-
exists
Mono<Boolean> exists(CosmosQuery query, Class<?> domainType, String containerName)
Exists- Parameters:
query- the document querydomainType- type classcontainerName- the container name- Returns:
- Mono of result
-
existsById
Mono<Boolean> existsById(Object id, Class<?> domainType, String containerName)
Exists- Parameters:
id- the iddomainType- type classcontainerName- the container name- Returns:
- Mono of result
-
count
Mono<Long> count(String containerName)
Count- Parameters:
containerName- the container name- Returns:
- Mono of result
-
count
Mono<Long> count(CosmosQuery query, String containerName)
Count- Parameters:
query- the document querycontainerName- the container name- Returns:
- Mono of result
-
count
Mono<Long> count(SqlQuerySpec querySpec, String containerName)
Count- Parameters:
querySpec- the document query speccontainerName- the container name- Returns:
- Mono of result
-
getConverter
MappingCosmosConverter getConverter()
To get converter- Returns:
- MappingCosmosConverter
-
runQuery
<T> Flux<T> runQuery(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(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
-
-