TDocument - The type that this collection will encode the fullDocument field into.public final class ChangeStreamDocument<TDocument>
extends java.lang.Object
$changeStream aggregation output document.
Note: this class will not be applicable for all change stream outputs. If using custom pipelines that radically change the change stream result, then an alternative document format should be used.
| Constructor and Description |
|---|
ChangeStreamDocument(BsonDocument resumeToken,
BsonDocument namespaceDocument,
TDocument fullDocument,
BsonDocument documentKey,
BsonTimestamp clusterTime,
OperationType operationType,
UpdateDescription updateDescription)
Deprecated.
|
ChangeStreamDocument(BsonDocument resumeToken,
MongoNamespace namespace,
TDocument fullDocument,
BsonDocument documentKey,
BsonTimestamp clusterTime,
OperationType operationType,
UpdateDescription updateDescription)
|
ChangeStreamDocument(BsonDocument resumeToken,
MongoNamespace namespace,
TDocument fullDocument,
BsonDocument documentKey,
OperationType operationType,
UpdateDescription updateDescription)
|
ChangeStreamDocument(OperationType operationType,
BsonDocument resumeToken,
BsonDocument namespaceDocument,
BsonDocument destinationNamespaceDocument,
TDocument fullDocument,
BsonDocument documentKey,
BsonTimestamp clusterTime,
UpdateDescription updateDescription)
Deprecated.
|
ChangeStreamDocument(OperationType operationType,
BsonDocument resumeToken,
BsonDocument namespaceDocument,
BsonDocument destinationNamespaceDocument,
TDocument fullDocument,
BsonDocument documentKey,
BsonTimestamp clusterTime,
UpdateDescription updateDescription,
BsonInt64 txnNumber,
BsonDocument lsid)
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
static <TFullDocument> |
createCodec(java.lang.Class<TFullDocument> fullDocumentClass,
CodecRegistry codecRegistry)
Creates the codec for the specific ChangeStreamOutput type
|
boolean |
equals(java.lang.Object o) |
BsonTimestamp |
getClusterTime()
Gets the cluster time at which the change occurred.
|
java.lang.String |
getDatabaseName()
Returns the database name
|
MongoNamespace |
getDestinationNamespace()
Returns the destination namespace, derived from the "to" field in a change stream document.
|
BsonDocument |
getDestinationNamespaceDocument()
Returns the destination namespace document, derived from the "to" field in a change stream document.
|
BsonDocument |
getDocumentKey()
Returns a document containing just the _id of the changed document.
|
TDocument |
getFullDocument()
Returns the fullDocument
|
BsonDocument |
getLsid()
Returns the identifier for the session associated with the transaction
|
MongoNamespace |
getNamespace()
Returns the namespace, derived from the "ns" field in a change stream document.
|
BsonDocument |
getNamespaceDocument()
Returns the namespace cocument, derived from the "ns" field in a change stream document.
|
OperationType |
getOperationType()
Returns the operationType
|
BsonDocument |
getResumeToken()
Returns the resumeToken
|
BsonInt64 |
getTxnNumber()
Returns the transaction number
|
UpdateDescription |
getUpdateDescription()
Returns the updateDescription
|
int |
hashCode() |
java.lang.String |
toString() |
@Deprecated public ChangeStreamDocument(BsonDocument resumeToken, MongoNamespace namespace, TDocument fullDocument, BsonDocument documentKey, OperationType operationType, UpdateDescription updateDescription)
ChangeStreamDocument(OperationType, BsonDocument, BsonDocument, BsonDocument, Object, BsonDocument,
BsonTimestamp, UpdateDescription)resumeToken - the resume tokennamespace - the namespacedocumentKey - a document containing the _id of the changed documentfullDocument - the fullDocumentoperationType - the operation typeupdateDescription - the update description@Deprecated public ChangeStreamDocument(BsonDocument resumeToken, MongoNamespace namespace, TDocument fullDocument, BsonDocument documentKey, @Nullable BsonTimestamp clusterTime, OperationType operationType, UpdateDescription updateDescription)
ChangeStreamDocument(OperationType, BsonDocument, BsonDocument, BsonDocument, Object, BsonDocument,
BsonTimestamp, UpdateDescription)resumeToken - the resume tokennamespace - the namespacedocumentKey - a document containing the _id of the changed documentclusterTime - the cluster time at which the change occurredfullDocument - the fullDocumentoperationType - the operation typeupdateDescription - the update description@Deprecated public ChangeStreamDocument(@BsonProperty(value="resumeToken") BsonDocument resumeToken, @BsonProperty(value="ns") BsonDocument namespaceDocument, @BsonProperty(value="fullDocument") TDocument fullDocument, @BsonProperty(value="documentKey") BsonDocument documentKey, @Nullable @BsonProperty(value="clusterTime") BsonTimestamp clusterTime, @BsonProperty(value="operationType") OperationType operationType, @BsonProperty(value="updateDescription") UpdateDescription updateDescription)
resumeToken - the resume tokennamespaceDocument - the BsonDocument representing the namespacefullDocument - the full documentdocumentKey - a document containing the _id of the changed documentclusterTime - the cluster time at which the change occuredoperationType - the operation typeupdateDescription - the update description@Deprecated public ChangeStreamDocument(@BsonProperty(value="operationType") OperationType operationType, @BsonProperty(value="resumeToken") BsonDocument resumeToken, @Nullable @BsonProperty(value="ns") BsonDocument namespaceDocument, @Nullable @BsonProperty(value="to") BsonDocument destinationNamespaceDocument, @Nullable @BsonProperty(value="fullDocument") TDocument fullDocument, @Nullable @BsonProperty(value="documentKey") BsonDocument documentKey, @Nullable @BsonProperty(value="clusterTime") BsonTimestamp clusterTime, @Nullable @BsonProperty(value="updateDescription") UpdateDescription updateDescription)
operationType - the operation typeresumeToken - the resume tokennamespaceDocument - the BsonDocument representing the namespacedestinationNamespaceDocument - the BsonDocument representing the destinatation namespacefullDocument - the full documentdocumentKey - a document containing the _id of the changed documentclusterTime - the cluster time at which the change occuredupdateDescription - the update descriptionpublic ChangeStreamDocument(@BsonProperty(value="operationType") OperationType operationType, @BsonProperty(value="resumeToken") BsonDocument resumeToken, @Nullable @BsonProperty(value="ns") BsonDocument namespaceDocument, @Nullable @BsonProperty(value="to") BsonDocument destinationNamespaceDocument, @Nullable @BsonProperty(value="fullDocument") TDocument fullDocument, @Nullable @BsonProperty(value="documentKey") BsonDocument documentKey, @Nullable @BsonProperty(value="clusterTime") BsonTimestamp clusterTime, @Nullable @BsonProperty(value="updateDescription") UpdateDescription updateDescription, @Nullable @BsonProperty(value="txnNumber") BsonInt64 txnNumber, @Nullable @BsonProperty(value="lsid") BsonDocument lsid)
operationType - the operation typeresumeToken - the resume tokennamespaceDocument - the BsonDocument representing the namespacedestinationNamespaceDocument - the BsonDocument representing the destinatation namespacefullDocument - the full documentdocumentKey - a document containing the _id of the changed documentclusterTime - the cluster time at which the change occuredupdateDescription - the update descriptiontxnNumber - the transaction numberlsid - the identifier for the session associated with the transactionpublic BsonDocument getResumeToken()
@BsonIgnore @Nullable public MongoNamespace getNamespace()
@BsonProperty(value="ns") @Nullable public BsonDocument getNamespaceDocument()
@BsonIgnore @Nullable public MongoNamespace getDestinationNamespace()
The destination namespace is used to indicate the destination of a collection rename event.
OperationType.RENAME@BsonProperty(value="to") @Nullable public BsonDocument getDestinationNamespaceDocument()
The destination namespace document is a BsonDocument containing the values associated with a MongoNamespace. The 'db' key refers to the database name and the 'coll' key refers to the collection name.
@BsonIgnore @Nullable public java.lang.String getDatabaseName()
@Nullable public TDocument getFullDocument()
@Nullable public BsonDocument getDocumentKey()
For unsharded collections this contains a single field, _id, with the value of the _id of the document updated. For sharded collections, this will contain all the components of the shard key in order, followed by the _id if the _id isn t part of the shard key.
@Nullable public BsonTimestamp getClusterTime()
public OperationType getOperationType()
@Nullable public UpdateDescription getUpdateDescription()
@Nullable public BsonInt64 getTxnNumber()
@Nullable public BsonDocument getLsid()
public static <TFullDocument> Codec<ChangeStreamDocument<TFullDocument>> createCodec(java.lang.Class<TFullDocument> fullDocumentClass, CodecRegistry codecRegistry)
TFullDocument - the fullDocument typefullDocumentClass - the class to use to represent the fullDocumentcodecRegistry - the codec registrypublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2010 - 2023 Adobe. All Rights Reserved