com.mysql.cj.xdevapi

## Interface AddStatement

All Superinterfaces:
  Statement<AddStatement,AddResult>

    public interface AddStatement
    extends Statement<AddStatement,AddResult>

A statement adding documents to a collection.

### Nested Class Summary

### Nested classes/interfaces inherited from interface com.mysql.cj.xdevapi.Statement

`Statement.LockContention`

### Method Summary

All Methods Instance Methods Abstract Methods
`AddStatement` `add(DbDoc... documents)` Add a sequence of DbDocs.
`AddStatement` `add(String jsonString)` Add a document as a JSON string.
`boolean` `isUpsert()` Check the upsert flag.
`AddStatement` `setUpsert(boolean upsert)` Set upsert flag on this statement.

### Methods inherited from interface com.mysql.cj.xdevapi.Statement

`bind, bind, bind, bind, clearBindings, execute, executeAsync`

### Method Detail

#### add

    AddStatement add(String jsonString)

Add a document as a JSON string.

Parameters:
  `jsonString` - document as a JSON string
Returns:
  `AddStatement`

#### add

    AddStatement add(DbDoc... documents)

Add a sequence of DbDocs.

Parameters:
  `documents` - one or more `DbDoc` documents
Returns:
  `AddStatement`

#### isUpsert

    boolean isUpsert()

Check the upsert flag.

Returns:
  true if this is an upsert statement.

#### setUpsert

    AddStatement setUpsert(boolean upsert)

Set upsert flag on this statement. Used internally by the `Collection.addOrReplaceOne(String, DbDoc)` method.

Parameters:
  `upsert` - if true then this statement will be executed as an upsert statement
Returns:
  `AddStatement`

Copyright © 2016, 2023, Oracle and/or its affiliates.