你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

ReactiveCosmosOperations Interface

public interface ReactiveCosmosOperations

Operation class of reactive cosmos

Method Summary

Modifier and Type Method and Description
abstract Mono<Void> <S,T>deleteEntities(CosmosEntityInformation<T,?> entityInformation, Iterable<S> entities)

Delete all items with bulk.

abstract Mono<Void> <S,T>deleteEntities(CosmosEntityInformation<T,?> entityInformation, Flux<S> entities)

Delete all items with bulk.

abstract Flux<S> <S,T>insertAll(CosmosEntityInformation<T,?> entityInformation, Iterable<S> entities)

Insert all items with bulk.

abstract Flux<S> <S,T>insertAll(CosmosEntityInformation<T,?> entityInformation, Flux<S> entities)

Insert all items with bulk.

abstract Flux<T> delete(CosmosQuery query, Class<T> domainType, String containerName)

Delete items matching query

abstract Mono<Void> deleteEntity(String containerName, T entity)

Delete using entity

abstract Flux<T> find(CosmosQuery query, Class<T> domainType, String containerName)

Find items

abstract Flux<T> findAll(PartitionKey partitionKey, Class<T> domainType)

Find all items in a given container with partition key

abstract Flux<T> findAll(Class<T> domainType)

Find all items in a given container

abstract Flux<T> findAll(String containerName, Class<T> domainType)

Find all items in a given container

abstract Mono<T> findById(Object id, Class<T> domainType)

Find by id

abstract Mono<T> findById(Object id, Class<T> domainType, PartitionKey partitionKey)

Find by id

abstract Mono<T> findById(String containerName, Object id, Class<T> domainType)

Find by id

abstract Mono<T> insert(T objectToSave, PartitionKey partitionKey)

Insert

abstract Mono<T> insert(String containerName, T objectToSave)

Insert

abstract Mono<T> insert(String containerName, T objectToSave, PartitionKey partitionKey)

Insert

abstract Mono<T> patch(Object id, PartitionKey partitionKey, Class<T> domainType, CosmosPatchOperations patchOperations)

patches item

abstract Mono<T> patch(Object id, PartitionKey partitionKey, Class<T> domainType, CosmosPatchOperations patchOperations, CosmosPatchItemRequestOptions options)

patches item

abstract Flux<T> runQuery(SqlQuerySpec querySpec, Class<?> domainType, Class<T> returnType)

Run the query.

abstract Flux<T> runQuery(SqlQuerySpec querySpec, Sort sort, Class<?> domainType, Class<T> returnType)

Run the query.

abstract Mono<T> upsert(T object)

Upsert an item with partition key

abstract Mono<T> upsert(String containerName, T object)

Upsert an item to container with partition key

abstract Mono<Long> count(SqlQuerySpec querySpec, String containerName)

Count

abstract Mono<Long> count(CosmosQuery query, String containerName)

Count

abstract Mono<Long> count(String containerName)

Count

abstract Mono<CosmosContainerResponse> createContainerIfNotExists(CosmosEntityInformation<?,?> information)

Creates a container if it doesn't already exist

abstract Mono<Void> deleteAll(String containerName, Class<?> domainType)

Delete all items in a container.

abstract Mono<Void> deleteById(String containerName, Object id, PartitionKey partitionKey)

Delete an item by id

abstract void deleteContainer(String containerName)

Delete container

abstract Mono<Boolean> exists(CosmosQuery query, Class<?> domainType, String containerName)

Exists

abstract Mono<Boolean> existsById(Object id, Class<?> domainType, String containerName)

Exists

abstract String getContainerName(Class<?> domainType)

Get container name

abstract Mono<CosmosContainerProperties> getContainerProperties(String containerName)

Get properties for specified container

abstract MappingCosmosConverter getConverter()

To get converter

abstract Mono<CosmosContainerProperties> replaceContainerProperties(String containerName, CosmosContainerProperties properties)

Replace container properties for the specified container

Method Details

<S,T>deleteEntities

public abstract Mono deleteEntities(CosmosEntityInformation entityInformation, Iterable entities)

Delete all items with bulk.

Parameters:

entityInformation - must not be null
entities - must not be null

Returns:

void Mono

<S,T>deleteEntities

public abstract Mono deleteEntities(CosmosEntityInformation entityInformation, Flux entities)

Delete all items with bulk.

Parameters:

entityInformation - must not be null
entities - must not be null

Returns:

void Mono

<S,T>insertAll

public abstract Flux insertAll(CosmosEntityInformation entityInformation, Iterable entities)

Insert all items with bulk.

Parameters:

entityInformation - must not be null
entities - must not be null

Returns:

Flux of result

<S,T>insertAll

public abstract Flux insertAll(CosmosEntityInformation entityInformation, Flux entities)

Insert all items with bulk.

Parameters:

entityInformation - must not be null
entities - must not be null

Returns:

Flux of result

delete

public abstract Flux delete(CosmosQuery query, Class domainType, String containerName)

Delete items matching query

Parameters:

query - the document query
domainType - type class
containerName - the container name

Returns:

Flux of results

deleteEntity

public abstract Mono deleteEntity(String containerName, T entity)

Delete using entity

Parameters:

containerName - the container name
entity - the entity object

Returns:

void Mono

find

public abstract Flux find(CosmosQuery query, Class domainType, String containerName)

Find items

Parameters:

query - the document query
domainType - type class
containerName - the container name

Returns:

Flux of results

findAll

public abstract Flux findAll(PartitionKey partitionKey, Class domainType)

Find all items in a given container with partition key

Parameters:

partitionKey - partition Key
domainType - the domainType

Returns:

Flux of results

findAll

public abstract Flux findAll(Class domainType)

Find all items in a given container

Parameters:

domainType - the domainType

Returns:

Flux of results

findAll

public abstract Flux findAll(String containerName, Class domainType)

Find all items in a given container

Parameters:

containerName - the containerName
domainType - the domainType

Returns:

Flux of results

findById

public abstract Mono findById(Object id, Class domainType)

Find by id

Parameters:

id - the id
domainType - the domainType

Returns:

Mono of result

findById

public abstract Mono findById(Object id, Class domainType, PartitionKey partitionKey)

Find by id

Parameters:

id - the id
domainType - type class
partitionKey - partition Key

Returns:

Mono of result

findById

public abstract Mono findById(String containerName, Object id, Class domainType)

Find by id

Parameters:

containerName - the containername
id - the id
domainType - type class

Returns:

Mono of result

insert

public abstract Mono insert(T objectToSave, PartitionKey partitionKey)

Insert

Parameters:

objectToSave - the object to save
partitionKey - the partition key

Returns:

Mono of result

insert

public abstract Mono insert(String containerName, T objectToSave)

Insert

Parameters:

containerName - must not be null
objectToSave - must not be null

Returns:

Mono of result

insert

public abstract Mono insert(String containerName, T objectToSave, PartitionKey partitionKey)

Insert

Parameters:

containerName - the container name
objectToSave - the object to save
partitionKey - the partition key

Returns:

Mono of result

patch

public abstract Mono patch(Object id, PartitionKey partitionKey, Class domainType, CosmosPatchOperations patchOperations)

patches item

Parameters:

id - must not be null
partitionKey - must not be null
domainType - must not be null
patchOperations - must not be null, max operations is 10

Returns:

the patched item

patch

public abstract Mono patch(Object id, PartitionKey partitionKey, Class domainType, CosmosPatchOperations patchOperations, CosmosPatchItemRequestOptions options)

patches item

Parameters:

id - must not be null
partitionKey - must not be null
domainType - must not be null
patchOperations - must not be null, max operations is 10
options - Optional CosmosPatchItemRequestOptions, e.g. options.setFilterPredicate("FROM products p WHERE p.used = false");

Returns:

Mono with the patched item

runQuery

public abstract Flux runQuery(SqlQuerySpec querySpec, Class domainType, Class returnType)

Run the query.

Parameters:

querySpec - the query spec
domainType - the domain type
returnType - the return type

Returns:

the flux

runQuery

public abstract Flux runQuery(SqlQuerySpec querySpec, Sort sort, Class domainType, Class returnType)

Run the query.

Parameters:

querySpec - the query spec
sort - the sort order
domainType - the domain type
returnType - the return type

Returns:

the flux

upsert

public abstract Mono upsert(T object)

Upsert an item with partition key

Parameters:

object - the object to upsert

Returns:

Mono of result

upsert

public abstract Mono upsert(String containerName, T object)

Upsert an item to container with partition key

Parameters:

containerName - the container name
object - the object to save

Returns:

Mono of result

count

public abstract Mono count(SqlQuerySpec querySpec, String containerName)

Count

Parameters:

querySpec - the document query spec
containerName - the container name

Returns:

Mono of result

count

public abstract Mono count(CosmosQuery query, String containerName)

Count

Parameters:

query - the document query
containerName - the container name

Returns:

Mono of result

count

public abstract Mono count(String containerName)

Count

Parameters:

containerName - the container name

Returns:

Mono of result

createContainerIfNotExists

public abstract Mono createContainerIfNotExists(CosmosEntityInformation information)

Creates a container if it doesn't already exist

Parameters:

information - the CosmosEntityInformation

Returns:

Mono of CosmosContainerResponse

deleteAll

public abstract Mono deleteAll(String containerName, Class domainType)

Delete all items in a container. Uses bulk if possible.

Parameters:

containerName - the container name
domainType - the domainType

Returns:

void Mono

deleteById

public abstract Mono deleteById(String containerName, Object id, PartitionKey partitionKey)

Delete an item by id

Parameters:

containerName - the container name
id - the id
partitionKey - the partition key

Returns:

void Mono

deleteContainer

public abstract void deleteContainer(String containerName)

Delete container

Parameters:

containerName - the container name

exists

public abstract Mono exists(CosmosQuery query, Class domainType, String containerName)

Exists

Parameters:

query - the document query
domainType - type class
containerName - the container name

Returns:

Mono of result

existsById

public abstract Mono existsById(Object id, Class domainType, String containerName)

Exists

Parameters:

id - the id
domainType - type class
containerName - the container name

Returns:

Mono of result

getContainerName

public abstract String getContainerName(Class domainType)

Get container name

Parameters:

domainType - the domainType

Returns:

container name

getContainerProperties

public abstract Mono getContainerProperties(String containerName)

Get properties for specified container

Parameters:

containerName - String

Returns:

CosmosContainerProperties

getConverter

public abstract MappingCosmosConverter getConverter()

To get converter

Returns:

MappingCosmosConverter

replaceContainerProperties

public abstract Mono replaceContainerProperties(String containerName, CosmosContainerProperties properties)

Replace container properties for the specified container

Parameters:

containerName - String
properties - CosmosContainerProperties

Returns:

CosmosContainerProperties

Applies to