Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPLIB-814: Change stream support for point-in-time pre and post-images #911

Merged
merged 1 commit into from
Apr 20, 2022

Conversation

jmikola
Copy link
Member

@jmikola jmikola commented Apr 8, 2022

https://jira.mongodb.org/browse/PHPLIB-814

Introduces fullDocumentBeforeChange option. Tests for specifying "whenAvailable" and "required" for both fullDocument and fullDocumentBeforeChange (requires MongoDB 6.0+ with changeStreamPreAndPostImages enabled on the collection).

Depends on #908.

@jmikola jmikola changed the title PHPLIB-814: Support point-in-time pre and post-images in change streams PHPLIB-814: Change stream support for point-in-time pre and post-images Apr 8, 2022
include both a delta describing the changes to the document, as well as a
copy of the entire document that was changed from some time after the change
occurred. The following values are supported:
Determines how the "fullDocument" response field will be populated for update
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aleksandr-rudo: I realized after submitting #910 (comment) that I forgot to add docs to this PR. Please take a look when you get a chance.

Per the commit message, I intentionally omitted mention of the "default" and "off" constants, since they're redundant.

public const FULL_DOCUMENT_WHEN_AVAILABLE = 'whenAvailable';
public const FULL_DOCUMENT_REQUIRED = 'required';

public const FULL_DOCUMENT_BEFORE_CHANGE_OFF = 'off';
Copy link
Member Author

@jmikola jmikola Apr 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I don't expect applications to use this constant (doing so would be equivalent to leaving the option unspecified), and therefore did not document it; however, I still wanted to define the constant since the server does accept it and we use the value in corresponding spec tests.

@jmikola jmikola force-pushed the phplib-814 branch 2 times, most recently from bbebf2c to 8e34a6a Compare April 13, 2022 16:59
@jmikola jmikola marked this pull request as ready for review April 13, 2022 16:59
@jmikola
Copy link
Member Author

jmikola commented Apr 14, 2022

Note: the CI build for this might include errors in existing change stream spec tests (see: #908 (comment)). If so, I'll create a new PHPLIB ticket to track that.

Edit: Created PHPLIB-842.

Introduces fullDocumentBeforeChange option. Tests for specifying "whenAvailable" and "required" for both fullDocument and fullDocumentBeforeChange (requires MongoDB 6.0+ with changeStreamPreAndPostImages enabled on the collection).

Intentionally omits mention of FULL_DOCUMENT_DEFAULT (related to PHPLIB-808) and FULL_DOCUMENT_BEFORE_CHANGE_OFF constants, since those redundantly specified default behavior.

Tests synced with mongodb/specifications@8978899
@jmikola jmikola merged commit 2704fb0 into mongodb:master Apr 20, 2022
@jmikola jmikola deleted the phplib-814 branch April 20, 2022 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants