Class UpdateDescription
java.lang.Object
com.mongodb.client.model.changestream.UpdateDescription
The update description for changed fields in a
$changeStream
operation.- Since:
- 3.6
-
Constructor Summary
ConstructorDescriptionUpdateDescription
(List<String> removedFields, BsonDocument updatedFields) Creates a new instanceUpdateDescription
(List<String> removedFields, BsonDocument updatedFields, List<TruncatedArray> truncatedArrays) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the removedFieldsReturns information about the updated fields of the array type when the changes are reported as truncations.Returns information about the updated fields excluding the fields reported viagetTruncatedArrays()
.int
hashCode()
toString()
-
Constructor Details
-
UpdateDescription
public UpdateDescription(@Nullable List<String> removedFields, @Nullable BsonDocument updatedFields) Creates a new instance- Parameters:
removedFields
- SeeUpdateDescription(List, BsonDocument, List)
.updatedFields
- SeeUpdateDescription(List, BsonDocument, List)
.- See Also:
-
UpdateDescription
public UpdateDescription(@Nullable @BsonProperty("removedFields") List<String> removedFields, @Nullable @BsonProperty("updatedFields") BsonDocument updatedFields, @Nullable @BsonProperty("truncatedArrays") List<TruncatedArray> truncatedArrays) - Parameters:
removedFields
- Names of the fields that were removed.updatedFields
- Information about the updated fields.truncatedArrays
- Information about the updated fields of the array type when the changes are reported as truncations. Ifnull
, thengetTruncatedArrays()
returns an emptyList
.- Since:
- 4.3
-
-
Method Details
-
getRemovedFields
Returns the removedFields- Returns:
- the removedFields
-
getUpdatedFields
Returns information about the updated fields excluding the fields reported viagetTruncatedArrays()
.Despite array fields reported via
getTruncatedArrays()
being excluded from the information returned by this method, changes to fields of the elements of the array values may be reported via this method. For example, given the original field"arrayField": ["foo", {"a": "bar"}, 1, 2, 3]
and the updated field"arrayField": ["foo", {"a": "bar", "b": 3}]
, the following is how such a change may be reported:An example showing how the aforementioned change may be reported Method Result getUpdatedFields()
{"arrayField.1.b": 3} getTruncatedArrays()
{"field": "arrayField", "newSize": 2} - Returns:
updatedFields
.- See Also:
-
getTruncatedArrays
Returns information about the updated fields of the array type when the changes are reported as truncations.- Returns:
truncatedArrays
. There are no guarantees on the mutability of theList
returned.- Since:
- 4.3
- See Also:
-
equals
- Overrides:
equals
in classObject
- Returns:
true
if and only if all of the following is true for the compared objects- Object.getClass() results are the same
- getRemovedFields() results are equal
- getUpdatedFields() results are equal
-
getTruncatedArrays() results are equal
or both contain no data (
null
or empty).
-
hashCode
public int hashCode() -
toString
-