Skip to content

Latest commit

 

History

History
145 lines (87 loc) · 6.35 KB

what-are-operations.java.markdown

File metadata and controls

145 lines (87 loc) · 6.35 KB

What are Operations

The RavenDB client API is built with the notion of layers. At the top, and what you will usually interact with, are the DocumentStore and the DocumentSession.

They in turn, are built on top of the notion of Operations and Commands.

Operations are an encapsulation of a set of low level commands which are used to manipulate data, execute administrative tasks, and change the configuration on a server.

They are available in the DocumentStore under the operations, maintenance, and maintenance().server methods.

{PANEL:Common Operations}

Common operations include set based operations for Patching or removal of documents by using queries (more can be read here).
There is also the ability to handle distributed Compare Exchange operations and manage Attachments and Counters.

How to Send an Operation

In order to execute an operation, you will need to use the send or sendAsync methods. Available overloads are: {CODE-TABS} {CODE-TAB:java:Sync Client_Operations_api@ClientApi\Operations\WhatAreOperations.java /} {CODE-TAB:java:Async Client_Operations_api_async@ClientApi\Operations\WhatAreOperations.java /} {CODE-TABS/}

The following operations are available:

Compare Exchange

Attachments

Patching

Counters

Misc

Example - Get Attachment

{CODE:java Client_Operations_1@ClientApi\Operations\WhatAreOperations.java /}

{PANEL/}

{PANEL:Maintenance Operations}

Maintenance operations include operations for changing the configuration at runtime and for management of index operations.

How to Send an Operation

{CODE:java Maintenance_Operations_api@ClientApi\Operations\WhatAreOperations.java /}

The following maintenance operations are available:

Client Configuration

Indexing

Misc

Example - Stop Index

{CODE:java Maintenance_Operations_1@ClientApi\Operations\WhatAreOperations.java /}

{PANEL/}

{PANEL:Server Operations}

These type of operations contain various administrative and miscellaneous configuration operations.

How to Send an Operation

{CODE-TABS} {CODE-TAB:java:Sync Server_Operations_api@ClientApi\Operations\WhatAreOperations.java /} {CODE-TAB:java:Async Server_Operations_api_async@ClientApi\Operations\WhatAreOperations.java /} {CODE-TABS/}

The following server-wide operations are available:

Cluster Management

Miscellaneous

Example - Get Build Number

{CODE:java Server_Operations_1@ClientApi\Operations\WhatAreOperations.java /}

{PANEL/}

Remarks

{NOTE By default, operations available in store.operations or store.maintenance are working on a default database that was setup for that store. To switch operations to a different database that is available on that server use the forDatabase method. /}

Related articles

Document Store

Operations