Package com.mysql.cj.xdevapi
Interface AddStatement
- All Superinterfaces:
Statement<AddStatement,AddResult>
- All Known Implementing Classes:
AddStatementImpl
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
Modifier and Type Method Description AddStatementadd(DbDoc... documents)Add a sequence of DbDocs.AddStatementadd(java.lang.String jsonString)Add a document as a JSON string.booleanisUpsert()Check the upsert flag.AddStatementsetUpsert(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 Details
-
add
Add a document as a JSON string.- Parameters:
jsonString- document as a JSON string- Returns:
AddStatement
-
add
Add a sequence of DbDocs.- Parameters:
documents- one or moreDbDocdocuments- Returns:
AddStatement
-
isUpsert
boolean isUpsert()Check the upsert flag.- Returns:
- true if this is an upsert statement.
-
setUpsert
Set upsert flag on this statement. Used internally by theCollection.addOrReplaceOne(String, DbDoc)method.- Parameters:
upsert- if true then this statement will be executed as an upsert statement- Returns:
AddStatement
-