Class ChangeStreamDocument<TDocument>
- java.lang.Object
-
- com.mongodb.client.model.changestream.ChangeStreamDocument<TDocument>
-
- Type Parameters:
TDocument
- The type that this collection will encode thefullDocument
field into.
@Deprecated(since="2021-05-27") public final class ChangeStreamDocument<TDocument> extends java.lang.Object
Deprecated.Usage of this API is not supported in AEM as a Cloud Service.Represents the$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.
- Since:
- 3.6
-
-
Constructor Summary
Constructors Constructor Description 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)
Deprecated.Creates a new instanceChangeStreamDocument(BsonDocument resumeToken, MongoNamespace namespace, TDocument fullDocument, BsonDocument documentKey, OperationType operationType, UpdateDescription updateDescription)
ChangeStreamDocument(BsonDocument resumeToken, MongoNamespace namespace, TDocument fullDocument, BsonDocument documentKey, BsonTimestamp clusterTime, OperationType operationType, UpdateDescription updateDescription)
ChangeStreamDocument(BsonDocument resumeToken, BsonDocument namespaceDocument, TDocument fullDocument, BsonDocument documentKey, BsonTimestamp clusterTime, OperationType operationType, UpdateDescription updateDescription)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <TFullDocument>
Codec<ChangeStreamDocument<TFullDocument>>createCodec(java.lang.Class<TFullDocument> fullDocumentClass, CodecRegistry codecRegistry)
Deprecated.Creates the codec for the specific ChangeStreamOutput typeboolean
equals(java.lang.Object o)
Deprecated.BsonTimestamp
getClusterTime()
Deprecated.Gets the cluster time at which the change occurred.java.lang.String
getDatabaseName()
Deprecated.Returns the database nameMongoNamespace
getDestinationNamespace()
Deprecated.Returns the destination namespace, derived from the "to" field in a change stream document.BsonDocument
getDestinationNamespaceDocument()
Deprecated.Returns the destination namespace document, derived from the "to" field in a change stream document.BsonDocument
getDocumentKey()
Deprecated.Returns a document containing just the _id of the changed document.TDocument
getFullDocument()
Deprecated.Returns the fullDocumentBsonDocument
getLsid()
Deprecated.Returns the identifier for the session associated with the transactionMongoNamespace
getNamespace()
Deprecated.Returns the namespace, derived from the "ns" field in a change stream document.BsonDocument
getNamespaceDocument()
Deprecated.Returns the namespace cocument, derived from the "ns" field in a change stream document.OperationType
getOperationType()
Deprecated.Returns the operationTypeBsonDocument
getResumeToken()
Deprecated.Returns the resumeTokenBsonInt64
getTxnNumber()
Deprecated.Returns the transaction numberUpdateDescription
getUpdateDescription()
Deprecated.Returns the updateDescriptionint
hashCode()
Deprecated.java.lang.String
toString()
Deprecated.
-
-
-
Constructor Detail
-
ChangeStreamDocument
@Deprecated public ChangeStreamDocument(BsonDocument resumeToken, MongoNamespace namespace, TDocument fullDocument, BsonDocument documentKey, OperationType operationType, UpdateDescription updateDescription)
Deprecated.Creates a new instance- Parameters:
resumeToken
- the resume tokennamespace
- the namespacedocumentKey
- a document containing the _id of the changed documentfullDocument
- the fullDocumentoperationType
- the operation typeupdateDescription
- the update description
-
ChangeStreamDocument
@Deprecated public ChangeStreamDocument(BsonDocument resumeToken, MongoNamespace namespace, TDocument fullDocument, BsonDocument documentKey, @Nullable BsonTimestamp clusterTime, OperationType operationType, UpdateDescription updateDescription)
Deprecated.Creates a new instance- Parameters:
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
-
ChangeStreamDocument
@Deprecated public ChangeStreamDocument(@BsonProperty("resumeToken") BsonDocument resumeToken, @BsonProperty("ns") BsonDocument namespaceDocument, @BsonProperty("fullDocument") TDocument fullDocument, @BsonProperty("documentKey") BsonDocument documentKey, @Nullable @BsonProperty("clusterTime") BsonTimestamp clusterTime, @BsonProperty("operationType") OperationType operationType, @BsonProperty("updateDescription") UpdateDescription updateDescription)
Deprecated.Creates a new instance- Parameters:
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- Since:
- 3.8
-
ChangeStreamDocument
@Deprecated public ChangeStreamDocument(@BsonProperty("operationType") OperationType operationType, @BsonProperty("resumeToken") BsonDocument resumeToken, @Nullable @BsonProperty("ns") BsonDocument namespaceDocument, @Nullable @BsonProperty("to") BsonDocument destinationNamespaceDocument, @Nullable @BsonProperty("fullDocument") TDocument fullDocument, @Nullable @BsonProperty("documentKey") BsonDocument documentKey, @Nullable @BsonProperty("clusterTime") BsonTimestamp clusterTime, @Nullable @BsonProperty("updateDescription") UpdateDescription updateDescription)
Deprecated.Creates a new instance- Parameters:
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 description- Since:
- 3.11
-
ChangeStreamDocument
public ChangeStreamDocument(@BsonProperty("operationType") OperationType operationType, @BsonProperty("resumeToken") BsonDocument resumeToken, @Nullable @BsonProperty("ns") BsonDocument namespaceDocument, @Nullable @BsonProperty("to") BsonDocument destinationNamespaceDocument, @Nullable @BsonProperty("fullDocument") TDocument fullDocument, @Nullable @BsonProperty("documentKey") BsonDocument documentKey, @Nullable @BsonProperty("clusterTime") BsonTimestamp clusterTime, @Nullable @BsonProperty("updateDescription") UpdateDescription updateDescription, @Nullable @BsonProperty("txnNumber") BsonInt64 txnNumber, @Nullable @BsonProperty("lsid") BsonDocument lsid)
Deprecated.Creates a new instance- Parameters:
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 transaction- Since:
- 3.11
-
-
Method Detail
-
getResumeToken
public BsonDocument getResumeToken()
Deprecated.Returns the resumeToken- Returns:
- the resumeToken
-
getNamespace
@BsonIgnore @Nullable public MongoNamespace getNamespace()
Deprecated.Returns the namespace, derived from the "ns" field in a change stream document. The invalidate operation type does include a MongoNamespace in the ChangeStreamDocument response. The dropDatabase operation type includes a MongoNamespace, but does not include a collection name as part of the namespace.- Returns:
- the namespace. If the namespaceDocument is null or if it is missing either the 'db' or 'coll' keys, then this will return null.
-
getNamespaceDocument
@BsonProperty("ns") @Nullable public BsonDocument getNamespaceDocument()
Deprecated.Returns the namespace cocument, derived from the "ns" field in a change stream document. The 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.- Returns:
- the namespaceDocument
- Since:
- 3.8
-
getDestinationNamespace
@BsonIgnore @Nullable public MongoNamespace getDestinationNamespace()
Deprecated.Returns the destination namespace, derived from the "to" field in a change stream document.The destination namespace is used to indicate the destination of a collection rename event.
- Returns:
- the namespace. If the "to" document is null or absent, then this will return null.
- Since:
- 3.11
- See Also:
OperationType.RENAME
-
getDestinationNamespaceDocument
@BsonProperty("to") @Nullable public BsonDocument getDestinationNamespaceDocument()
Deprecated.Returns the destination namespace document, derived from the "to" field in a change stream document.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.
- Returns:
- the destinationNamespaceDocument
- Since:
- 3.11
-
getDatabaseName
@BsonIgnore @Nullable public java.lang.String getDatabaseName()
Deprecated.Returns the database name- Returns:
- the databaseName. If the namespaceDocument is null or if it is missing the 'db' key, then this will return null.
- Since:
- 3.8
-
getFullDocument
@Nullable public TDocument getFullDocument()
Deprecated.Returns the fullDocument- Returns:
- the fullDocument
-
getDocumentKey
@Nullable public BsonDocument getDocumentKey()
Deprecated.Returns a document containing just the _id of the changed document.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.
- Returns:
- the document key, or null if the event is not associated with a single document (e.g. a collection rename event)
-
getClusterTime
@Nullable public BsonTimestamp getClusterTime()
Deprecated.Gets the cluster time at which the change occurred.- Returns:
- the cluster time at which the change occurred
- Since:
- 3.8
-
getOperationType
public OperationType getOperationType()
Deprecated.Returns the operationType- Returns:
- the operationType
-
getUpdateDescription
@Nullable public UpdateDescription getUpdateDescription()
Deprecated.Returns the updateDescription- Returns:
- the updateDescription, or null if the event is not associated with a single document (e.g. a collection rename event)
-
getTxnNumber
@Nullable public BsonInt64 getTxnNumber()
Deprecated.Returns the transaction number- Returns:
- the transaction number, or null if not part of a multi-document transaction
- Since:
- 3.11
-
getLsid
@Nullable public BsonDocument getLsid()
Deprecated.Returns the identifier for the session associated with the transaction- Returns:
- the lsid, or null if not part of a multi-document transaction
- Since:
- 3.11
-
createCodec
public static <TFullDocument> Codec<ChangeStreamDocument<TFullDocument>> createCodec(java.lang.Class<TFullDocument> fullDocumentClass, CodecRegistry codecRegistry)
Deprecated.Creates the codec for the specific ChangeStreamOutput type- Type Parameters:
TFullDocument
- the fullDocument type- Parameters:
fullDocumentClass
- the class to use to represent the fullDocumentcodecRegistry
- the codec registry- Returns:
- the codec
-
equals
public boolean equals(java.lang.Object o)
Deprecated.- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
Deprecated.- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toString
in classjava.lang.Object
-
-