public class CosmosAsyncContainer extends Object
| Modifier and Type | Method and Description |
|---|---|
<T> Mono<CosmosItemResponse<T>> |
createItem(T item)
Creates an item.
|
<T> Mono<CosmosItemResponse<T>> |
createItem(T item,
CosmosItemRequestOptions options)
Creates a Cosmos item.
|
<T> Mono<CosmosItemResponse<T>> |
createItem(T item,
PartitionKey partitionKey,
CosmosItemRequestOptions options)
Creates an item.
|
Mono<CosmosContainerResponse> |
delete()
Deletes the current container.
|
Mono<CosmosContainerResponse> |
delete(CosmosContainerRequestOptions options)
Deletes the container
|
Mono<CosmosItemResponse<Object>> |
deleteItem(String itemId,
PartitionKey partitionKey)
Deletes an item.
|
Mono<CosmosItemResponse<Object>> |
deleteItem(String itemId,
PartitionKey partitionKey,
CosmosItemRequestOptions options)
Deletes the item.
|
<T> Mono<CosmosItemResponse<Object>> |
deleteItem(T item,
CosmosItemRequestOptions options)
Deletes the item.
|
CosmosAsyncConflict |
getConflict(String id)
Gets a
CosmosAsyncConflict object using current container for context. |
CosmosAsyncDatabase |
getDatabase()
Gets the parent
CosmosAsyncDatabase for the current container. |
String |
getId()
Get the id of the
CosmosAsyncContainer. |
CosmosAsyncScripts |
getScripts()
Gets a
CosmosAsyncScripts using the current container as context. |
CosmosPagedFlux<CosmosConflictProperties> |
queryConflicts(String query)
Queries all the conflicts in the current container.
|
CosmosPagedFlux<CosmosConflictProperties> |
queryConflicts(String query,
CosmosQueryRequestOptions options)
Queries all the conflicts in the current container.
|
<T> CosmosPagedFlux<T> |
queryItems(SqlQuerySpec querySpec,
Class<T> classType)
Query for items in the current container using a
SqlQuerySpec. |
<T> CosmosPagedFlux<T> |
queryItems(SqlQuerySpec querySpec,
CosmosQueryRequestOptions options,
Class<T> classType)
Query for items in the current container using a
SqlQuerySpec and CosmosQueryRequestOptions. |
<T> CosmosPagedFlux<T> |
queryItems(String query,
Class<T> classType)
Query for items in the current container.
|
<T> CosmosPagedFlux<T> |
queryItems(String query,
CosmosQueryRequestOptions options,
Class<T> classType)
Query for items in the current container using a string.
|
Mono<CosmosContainerResponse> |
read()
Reads the current container.
|
Mono<CosmosContainerResponse> |
read(CosmosContainerRequestOptions options)
Reads the current container while specifying additional options such as If-Match.
|
CosmosPagedFlux<CosmosConflictProperties> |
readAllConflicts(CosmosQueryRequestOptions options)
Lists all the conflicts in the current container.
|
<T> CosmosPagedFlux<T> |
readAllItems(PartitionKey partitionKey,
Class<T> classType)
Reads all the items of a logical partition
|
<T> CosmosPagedFlux<T> |
readAllItems(PartitionKey partitionKey,
CosmosQueryRequestOptions options,
Class<T> classType)
Reads all the items of a logical partition
|
<T> Mono<CosmosItemResponse<T>> |
readItem(String itemId,
PartitionKey partitionKey,
Class<T> itemType)
Reads an item.
|
<T> Mono<CosmosItemResponse<T>> |
readItem(String itemId,
PartitionKey partitionKey,
CosmosItemRequestOptions options,
Class<T> itemType)
Reads an item using a configured
CosmosItemRequestOptions. |
<T> Mono<FeedResponse<T>> |
readMany(List<CosmosItemIdentity> itemIdentityList,
Class<T> classType)
Reads many documents.
|
<T> Mono<FeedResponse<T>> |
readMany(List<CosmosItemIdentity> itemIdentityList,
String sessionToken,
Class<T> classType)
Reads many documents.
|
Mono<ThroughputResponse> |
readThroughput()
Read the throughput provisioned for the current container.
|
Mono<CosmosContainerResponse> |
replace(CosmosContainerProperties containerProperties)
Replaces the current container's properties.
|
Mono<CosmosContainerResponse> |
replace(CosmosContainerProperties containerProperties,
CosmosContainerRequestOptions options)
Replaces the current container properties while using non-default request options.
|
<T> Mono<CosmosItemResponse<T>> |
replaceItem(T item,
String itemId,
PartitionKey partitionKey)
Replaces an item with the passed in item.
|
<T> Mono<CosmosItemResponse<T>> |
replaceItem(T item,
String itemId,
PartitionKey partitionKey,
CosmosItemRequestOptions options)
Replaces an item with the passed in item.
|
Mono<ThroughputResponse> |
replaceThroughput(ThroughputProperties throughputProperties)
Replace the throughput.
|
<T> Mono<CosmosItemResponse<T>> |
upsertItem(T item)
Upserts an item.
|
<T> Mono<CosmosItemResponse<T>> |
upsertItem(T item,
CosmosItemRequestOptions options)
Upserts an item.
|
<T> Mono<CosmosItemResponse<T>> |
upsertItem(T item,
PartitionKey partitionKey,
CosmosItemRequestOptions options)
Upserts an item.
|
public String getId()
CosmosAsyncContainer.CosmosAsyncContainer.public Mono<CosmosContainerResponse> read()
After subscription the operation will be performed. The Mono upon
successful completion will contain a single Cosmos container response with
the read container. In case of failure the Mono will error.
Mono containing the single Cosmos container response with
the read container or an error.public Mono<CosmosContainerResponse> read(CosmosContainerRequestOptions options)
After subscription the operation will be performed. The Mono upon
successful completion will contain a single Cosmos container response with
the read container. In case of failure the Mono will error.
options - the Cosmos container request options.Mono containing the single Cosmos container response with
the read container or an error.public Mono<CosmosContainerResponse> delete(CosmosContainerRequestOptions options)
After subscription the operation will be performed. The Mono upon
successful completion will contain a single Cosmos container response for the
deleted database. In case of failure the Mono will error.
options - the request options.Mono containing the single Cosmos container response for
the deleted database or an error.public Mono<CosmosContainerResponse> delete()
After subscription the operation will be performed. The Mono upon
successful completion will contain a single Cosmos container response for the
deleted container. In case of failure the Mono will error.
Mono containing the single Cosmos container response for
the deleted container or an error.public Mono<CosmosContainerResponse> replace(CosmosContainerProperties containerProperties)
After subscription the operation will be performed. The Mono upon
successful completion will contain a single Cosmos container response with
the replaced container properties. In case of failure the Mono will
error.
containerProperties - the container propertiesMono containing the single Cosmos container response with
the replaced container properties or an error.public Mono<CosmosContainerResponse> replace(CosmosContainerProperties containerProperties, CosmosContainerRequestOptions options)
After subscription the operation will be performed. The Mono upon
successful completion will contain a single Cosmos container response with
the replaced container properties. In case of failure the Mono will
error.
containerProperties - the container propertiesoptions - the Cosmos container request options.Mono containing the single Cosmos container response with
the replaced container properties or an error.public <T> Mono<CosmosItemResponse<T>> createItem(T item)
After subscription the operation will be performed. The Mono upon
successful completion will contain a single resource response with the
created Cosmos item. In case of failure the Mono will error.
T - the type parameter.item - the Cosmos item represented as a POJO or Cosmos item object.Mono containing the single resource response with the
created Cosmos item or an error.public <T> Mono<CosmosItemResponse<T>> createItem(T item, PartitionKey partitionKey, CosmosItemRequestOptions options)
After subscription the operation will be performed. The Mono upon
successful completion will contain a single resource response with the
created Cosmos item. In case of failure the Mono will error.
T - the type parameter.item - the Cosmos item represented as a POJO or Cosmos item object.partitionKey - the partition key.options - the request options.Mono containing the single resource response with the created Cosmos item or an error.public <T> Mono<CosmosItemResponse<T>> createItem(T item, CosmosItemRequestOptions options)
T - the type parameter.item - the item.options - the item request options.Mono containing the single resource response with the created Cosmos item or an error.public <T> Mono<CosmosItemResponse<T>> upsertItem(T item)
After subscription the operation will be performed. The Mono upon
successful completion will contain a single resource response with the
upserted item. In case of failure the Mono will error.
T - the type parameter.item - the item represented as a POJO or Item object to upsert.Mono containing the single resource response with the upserted item or an error.public <T> Mono<CosmosItemResponse<T>> upsertItem(T item, CosmosItemRequestOptions options)
After subscription the operation will be performed. The Mono upon
successful completion will contain a single resource response with the
upserted item. In case of failure the Mono will error.
T - the type parameter.item - the item represented as a POJO or Item object to upsert.options - the request options.Mono containing the single resource response with the upserted item or an error.public <T> Mono<CosmosItemResponse<T>> upsertItem(T item, PartitionKey partitionKey, CosmosItemRequestOptions options)
After subscription the operation will be performed. The Mono upon
successful completion will contain a single resource response with the
upserted item. In case of failure the Mono will error.
T - the type parameter.item - the item represented as a POJO or Item object to upsert.partitionKey - the partition key.options - the request options.Mono containing the single resource response with the upserted item or an error.public <T> CosmosPagedFlux<T> queryItems(String query, Class<T> classType)
After subscription the operation will be performed. The CosmosPagedFlux will
contain one or several feed response of the obtained items. In case of
failure the CosmosPagedFlux will error.
T - the type parameter.query - the query.classType - the class type.CosmosPagedFlux containing one or several feed response pages of the obtained items or an
error.public <T> CosmosPagedFlux<T> queryItems(String query, CosmosQueryRequestOptions options, Class<T> classType)
After subscription the operation will be performed. The CosmosPagedFlux will
contain one or several feed response of the obtained items. In case of
failure the CosmosPagedFlux will error.
T - the type parameter.query - the query.options - the query request options.classType - the class type.CosmosPagedFlux containing one or several feed response pages of the obtained items or an
error.public <T> CosmosPagedFlux<T> queryItems(SqlQuerySpec querySpec, Class<T> classType)
SqlQuerySpec.
After subscription the operation will be performed. The CosmosPagedFlux will
contain one or several feed response of the obtained items. In case of
failure the CosmosPagedFlux will error.
T - the type parameter.querySpec - the SQL query specification.classType - the class type.CosmosPagedFlux containing one or several feed response pages of the obtained items or an
error.public <T> CosmosPagedFlux<T> queryItems(SqlQuerySpec querySpec, CosmosQueryRequestOptions options, Class<T> classType)
SqlQuerySpec and CosmosQueryRequestOptions.
After subscription the operation will be performed. The Flux will
contain one or several feed response of the obtained items. In case of
failure the CosmosPagedFlux will error.
T - the type parameter.querySpec - the SQL query specification.options - the query request options.classType - the class type.CosmosPagedFlux containing one or several feed response pages of the obtained items or an
error.public <T> Mono<CosmosItemResponse<T>> readItem(String itemId, PartitionKey partitionKey, Class<T> itemType)
After subscription the operation will be performed.
The Mono upon successful completion will contain an item response with the read item.
T - the type parameter.itemId - the item id.partitionKey - the partition key.itemType - the item type.Mono containing the Cosmos item response with the read item or an error.public <T> Mono<CosmosItemResponse<T>> readItem(String itemId, PartitionKey partitionKey, CosmosItemRequestOptions options, Class<T> itemType)
CosmosItemRequestOptions.
After subscription the operation will be performed.
The Mono upon successful completion will contain a Cosmos item response with the read item.
T - the type parameter.itemId - the item id.partitionKey - the partition key.options - the request CosmosItemRequestOptions.itemType - the item type.Mono containing the Cosmos item response with the read item or an error.@Beta(value=V4_4_0) public <T> Mono<FeedResponse<T>> readMany(List<CosmosItemIdentity> itemIdentityList, Class<T> classType)
T - the type parameteritemIdentityList - CosmosItem id and partition key tuple of items that that needs to be readclassType - class type@Beta(value=V4_4_0) public <T> Mono<FeedResponse<T>> readMany(List<CosmosItemIdentity> itemIdentityList, String sessionToken, Class<T> classType)
T - the type parameteritemIdentityList - CosmosItem id and partition key tuple of items that that needs to be readsessionToken - the optional Session token - null if the read can be made without specific session tokenclassType - class typepublic <T> CosmosPagedFlux<T> readAllItems(PartitionKey partitionKey, Class<T> classType)
After subscription the operation will be performed. The CosmosPagedFlux will
contain one or several feed responses of the read Cosmos items. In case of
failure the CosmosPagedFlux will error.
T - the type parameter.partitionKey - the partition key value of the documents that need to be readclassType - the class type.CosmosPagedFlux containing one or several feed response pages
of the read Cosmos items or an error.public <T> CosmosPagedFlux<T> readAllItems(PartitionKey partitionKey, CosmosQueryRequestOptions options, Class<T> classType)
After subscription the operation will be performed. The CosmosPagedFlux will
contain one or several feed responses of the read Cosmos items. In case of
failure the CosmosPagedFlux will error.
T - the type parameter.partitionKey - the partition key value of the documents that need to be readoptions - the feed options.classType - the class type.CosmosPagedFlux containing one or several feed response pages
of the read Cosmos items or an error.public <T> Mono<CosmosItemResponse<T>> replaceItem(T item, String itemId, PartitionKey partitionKey)
After subscription the operation will be performed.
The Mono upon successful completion will contain a single Cosmos item response with the replaced item.
T - the type parameter.item - the item to replace (containing the item id).itemId - the item id.partitionKey - the partition key.Mono containing the Cosmos item resource response with the replaced item or an error.public <T> Mono<CosmosItemResponse<T>> replaceItem(T item, String itemId, PartitionKey partitionKey, CosmosItemRequestOptions options)
After subscription the operation will be performed.
The Mono upon successful completion will contain a single Cosmos item response with the replaced item.
T - the type parameter.item - the item to replace (containing the item id).itemId - the item id.partitionKey - the partition key.options - the request comosItemRequestOptions.Mono containing the Cosmos item resource response with the replaced item or an error.public Mono<CosmosItemResponse<Object>> deleteItem(String itemId, PartitionKey partitionKey)
After subscription the operation will be performed.
The Mono upon successful completion will contain a single Cosmos item response for the deleted item.
itemId - the item id.partitionKey - the partition key.Mono containing the Cosmos item resource response.public Mono<CosmosItemResponse<Object>> deleteItem(String itemId, PartitionKey partitionKey, CosmosItemRequestOptions options)
After subscription the operation will be performed.
The Mono upon successful completion will contain a single Cosmos item response for the deleted item.
itemId - id of the item.partitionKey - partitionKey of the item.options - the request options.Mono containing the Cosmos item resource response.public <T> Mono<CosmosItemResponse<Object>> deleteItem(T item, CosmosItemRequestOptions options)
After subscription the operation will be performed.
The Mono upon successful completion will contain a single Cosmos item response for the deleted item.
T - the type parameter.item - item to be deleted.options - the request options.Mono containing the Cosmos item resource response.public CosmosAsyncScripts getScripts()
CosmosAsyncScripts using the current container as context.
This can be further used to perform various operations on Cosmos scripts.
CosmosAsyncScripts.public CosmosPagedFlux<CosmosConflictProperties> readAllConflicts(CosmosQueryRequestOptions options)
options - the query request optionsCosmosPagedFlux containing one or several feed response pages of the
obtained conflicts or an error.public CosmosPagedFlux<CosmosConflictProperties> queryConflicts(String query)
query - the query.CosmosPagedFlux containing one or several feed response pages of the
obtained conflicts or an error.public CosmosPagedFlux<CosmosConflictProperties> queryConflicts(String query, CosmosQueryRequestOptions options)
query - the query.options - the query request options.CosmosPagedFlux containing one or several feed response pages of the
obtained conflicts or an error.public CosmosAsyncConflict getConflict(String id)
CosmosAsyncConflict object using current container for context.id - the id of the Cosmos conflict.public Mono<ThroughputResponse> replaceThroughput(ThroughputProperties throughputProperties)
throughputProperties - the throughput properties.public Mono<ThroughputResponse> readThroughput()
public CosmosAsyncDatabase getDatabase()
CosmosAsyncDatabase for the current container.CosmosAsyncDatabase.Copyright © 2020 Microsoft Corporation. All rights reserved.