Skip to content

Commit

Permalink
Change Streams fullDocumentBeforeChange support
Browse files Browse the repository at this point in the history
  • Loading branch information
kufd committed Oct 6, 2022
1 parent 5fb2b68 commit 7722b66
Showing 1 changed file with 4 additions and 16 deletions.
Expand Up @@ -155,33 +155,21 @@ public String getCollectionName() {
@Nullable
public T getBody() {

if (raw == null) {
if (raw == null || raw.getFullDocument() == null) {
return null;
}

Document fullDocument = raw.getFullDocument();

if (fullDocument == null) {
return targetType.cast(fullDocument);
}

return getConvertedFullDocument(fullDocument);
return getConvertedFullDocument(raw.getFullDocument());
}

@Nullable
public T getBodyBeforeChange() {

if (raw == null) {
if (raw == null || raw.getFullDocumentBeforeChange() == null) {
return null;
}

Document fullDocumentBeforeChange = raw.getFullDocumentBeforeChange();

if (fullDocumentBeforeChange == null) {
return targetType.cast(fullDocumentBeforeChange);
}

return getConvertedFullDocumentBeforeChange(fullDocumentBeforeChange);
return getConvertedFullDocumentBeforeChange(raw.getFullDocumentBeforeChange());
}

@SuppressWarnings("unchecked")
Expand Down

0 comments on commit 7722b66

Please sign in to comment.