public class WriteResult
extends java.lang.Object
UnsupportedOperationException.| 构造器和说明 |
|---|
WriteResult(int n,
boolean updateOfExisting,
java.lang.Object upsertedId)
Construct a new instance.
|
| 限定符和类型 | 方法和说明 |
|---|---|
int |
getN()
Gets the "n" field, which contains the number of documents affected in the write operation.
|
java.lang.Object |
getUpsertedId()
Gets the _id value of an upserted document that resulted from this write.
|
boolean |
isUpdateOfExisting()
Returns true if this write resulted in an update of an existing document.
|
java.lang.String |
toString() |
static WriteResult |
unacknowledged()
Gets an instance representing an unacknowledged write.
|
boolean |
wasAcknowledged()
Returns true if the write was acknowledged.
|
public WriteResult(int n,
boolean updateOfExisting,
java.lang.Object upsertedId)
n - the number of existing documents affected by this operationupdateOfExisting - true if the operation was an update and an existing document was updatedupsertedId - the _id of a document that was upserted by this operationpublic static WriteResult unacknowledged()
public boolean wasAcknowledged()
WriteConcern.UNACKNOWLEDGEDpublic int getN()
java.lang.UnsupportedOperationException - if the write was unacknowledgedWriteConcern.UNACKNOWLEDGEDpublic java.lang.Object getUpsertedId()
java.lang.UnsupportedOperationException - if the write was unacknowledgedpublic boolean isUpdateOfExisting()
java.lang.UnsupportedOperationException - if the write was unacknowledgedpublic java.lang.String toString()
toString 在类中 java.lang.Object