io.vertx.ext.mongo

## Class BulkOperation

- java.lang.Object
- - io.vertx.ext.mongo.BulkOperation

-     public class BulkOperation
      extends Object

  Contains all data needed for one operation of a bulk write operation.
  Author:
    sschmitt

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `BulkOperation.BulkOperationType` Enum for the different possible operations

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BulkOperation(JsonObject json)` Json constructor

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static BulkOperation` | `createDelete(JsonObject filter)` Create a new delete operation with the given filter
    `static BulkOperation` | `createInsert(JsonObject document)` Create a new insert operation with the given document
    `static BulkOperation` | `createReplace(JsonObject filter, JsonObject document)` Create a new replace operation with the given filter and replace document
    `static BulkOperation` | `createReplace(JsonObject filter, JsonObject document, boolean upsert)` Create a new replace operation with the given filter, replace document, and the upsert flag
    `static BulkOperation` | `createUpdate(JsonObject filter, JsonObject document)` Create a new update operation with the given filter and update document
    `static BulkOperation` | `createUpdate(JsonObject filter, JsonObject document, boolean upsert, boolean multi)` Create a new update operation with the given filter, update document, the upsert flag, and multi flag
    `JsonObject` | `getDocument()` Returns the document, used by insert, replace, and update operations
    `JsonObject` | `getFilter()` Returns the filter document, used by replace, update, and delete operations
    `BulkOperation.BulkOperationType` | `getType()` Returns the operation type
    `boolean` | `isMulti()` Returns the multi flag, used by update and delete operations
    `boolean` | `isUpsert()` Returns the upsert flag, used by update and replace operations
    `BulkOperation` | `setDocument(JsonObject document)` Sets the document, used by insert, replace, and update operations
    `BulkOperation` | `setFilter(JsonObject filter)` Sets the filter document, used by replace, update, and delete operations
    `BulkOperation` | `setMulti(boolean multi)` Sets the multi flag, used by update and delete operations
    `BulkOperation` | `setType(BulkOperation.BulkOperationType type)` Sets the operation type
    `BulkOperation` | `setUpsert(boolean upsert)` Sets the upsert flag, used by update and replace operations
    `JsonObject` | `toJson()` Generate a json from this object

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BulkOperation

          public BulkOperation(JsonObject json)

      Json constructor
      Parameters:
        `json` - the json object

  - ### Method Detail

    - #### toJson

          public JsonObject toJson()

      Generate a json from this object
      Returns:
        the json representation

    - #### createDelete

          public static BulkOperation createDelete(JsonObject filter)

      Create a new delete operation with the given filter
      Parameters:
        `filter` - the filter
      Returns:
        a new delete operation instance

    - #### createInsert

          public static BulkOperation createInsert(JsonObject document)

      Create a new insert operation with the given document
      Parameters:
        `document` - the document to insert
      Returns:
        a new insert operation instance

    - #### createReplace

          public static BulkOperation createReplace(JsonObject filter,
                                                    JsonObject document)

      Create a new replace operation with the given filter and replace document
      Parameters:
        `filter` - the filter
        `document` - the replace document
      Returns:
        a new replace operation instance

    - #### createReplace

          public static BulkOperation createReplace(JsonObject filter,
                                                    JsonObject document,
                                                    boolean upsert)

      Create a new replace operation with the given filter, replace document, and the upsert flag
      Parameters:
        `filter` - the filter
        `document` - the replace document
        `upsert` - the upsert flag
      Returns:
        a new replace operation instance

    - #### createUpdate

          public static BulkOperation createUpdate(JsonObject filter,
                                                   JsonObject document)

      Create a new update operation with the given filter and update document
      Parameters:
        `filter` - the filter
        `document` - the update document
      Returns:
        a new update operation instance

    - #### createUpdate

          public static BulkOperation createUpdate(JsonObject filter,
                                                   JsonObject document,
                                                   boolean upsert,
                                                   boolean multi)

      Create a new update operation with the given filter, update document, the upsert flag, and multi flag
      Parameters:
        `filter` - the filter
        `document` - the update document
        `upsert` - the upsert flag
        `multi` - the multi flag
      Returns:
        a new update operation instance

    - #### getType

          public BulkOperation.BulkOperationType getType()

      Returns the operation type
      Returns:
        the operation type

    - #### setType

          public BulkOperation setType(BulkOperation.BulkOperationType type)

      Sets the operation type
      Parameters:
        `type` - the operation type
      Returns:
        this for fluency

    - #### getFilter

          public JsonObject getFilter()

      Returns the filter document, used by replace, update, and delete operations
      Returns:
        the filter document

    - #### setFilter

          public BulkOperation setFilter(JsonObject filter)

      Sets the filter document, used by replace, update, and delete operations
      Parameters:
        `filter` - the filter document
      Returns:
        this for fluency

    - #### getDocument

          public JsonObject getDocument()

      Returns the document, used by insert, replace, and update operations
      Returns:
        the document

    - #### setDocument

          public BulkOperation setDocument(JsonObject document)

      Sets the document, used by insert, replace, and update operations
      Parameters:
        `document` - the document
      Returns:
        this for fluency

    - #### isUpsert

          public boolean isUpsert()

      Returns the upsert flag, used by update and replace operations
      Returns:
        the upsert flag

    - #### setUpsert

          public BulkOperation setUpsert(boolean upsert)

      Sets the upsert flag, used by update and replace operations
      Parameters:
        `upsert` - the upsert flag
      Returns:
        this for fluency

    - #### isMulti

          public boolean isMulti()

      Returns the multi flag, used by update and delete operations
      Returns:
        the multi flag

    - #### setMulti

          public BulkOperation setMulti(boolean multi)

      Sets the multi flag, used by update and delete operations
      Parameters:
        `multi` - the mutli flag
      Returns:
        this for fluency

Copyright © 2017. All rights reserved.