Class ChangeStreamEvent<T>
java.lang.Object
org.springframework.data.mongodb.core.ChangeStreamEvent<T>
Message
implementation specific to MongoDB Change
Streams.- Since:
- 2.1
- Author:
- Christoph Strobl, Mark Paluch, Myroslav Kosinskyi
-
Constructor Summary
ConstructorDescriptionChangeStreamEvent
(com.mongodb.client.model.changestream.ChangeStreamDocument<org.bson.Document> raw, Class<T> targetType, MongoConverter converter) -
Method Summary
Modifier and TypeMethodDescriptionboolean
getBody()
Get the potentially convertedChangeStreamDocument.getFullDocument()
.Get the potentially converteddocument
before being changed.org.bson.BsonTimestamp
Get thecluster time
.Get the collection name the event was originated at.Get the database name the event was originated at.com.mongodb.client.model.changestream.OperationType
Get theoperation type
for this event.com.mongodb.client.model.changestream.ChangeStreamDocument<org.bson.Document>
getRaw()
Get the rawChangeStreamDocument
as emitted by the driver.org.bson.BsonValue
Get theresume token
for this event.Get thecluster time
asInstant
the event was emitted at.int
hashCode()
toString()
-
Constructor Details
-
ChangeStreamEvent
public ChangeStreamEvent(@Nullable com.mongodb.client.model.changestream.ChangeStreamDocument<org.bson.Document> raw, Class<T> targetType, MongoConverter converter) - Parameters:
raw
- can be null.targetType
- must not be null.converter
- must not be null.
-
-
Method Details
-
getRaw
@Nullable public com.mongodb.client.model.changestream.ChangeStreamDocument<org.bson.Document> getRaw()Get the rawChangeStreamDocument
as emitted by the driver.- Returns:
- can be null.
-
getTimestamp
Get thecluster time
asInstant
the event was emitted at.- Returns:
- can be null.
-
getBsonTimestamp
Get thecluster time
.- Returns:
- can be null.
- Since:
- 2.2
-
getResumeToken
Get theresume token
for this event.- Returns:
- can be null.
-
getOperationType
Get theoperation type
for this event.- Returns:
- can be null.
-
getDatabaseName
Get the database name the event was originated at.- Returns:
- can be null.
-
getCollectionName
Get the collection name the event was originated at.- Returns:
- can be null.
-
getBody
Get the potentially convertedChangeStreamDocument.getFullDocument()
.- Returns:
- null when
getRaw()
orChangeStreamDocument.getFullDocument()
is null.
-
getBodyBeforeChange
Get the potentially converteddocument
before being changed.- Returns:
- null when
getRaw()
orChangeStreamDocument.getFullDocumentBeforeChange()
is null. - Since:
- 4.0
-
toString
-
equals
-
hashCode
public int hashCode()
-