-
Notifications
You must be signed in to change notification settings - Fork 34
DOCSP-41973 Read Landing Page #148
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
DOCSP-41973 Read Landing Page #148
Conversation
✅ Deploy Preview for docs-php-library ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with one fix!
for ($changeStream->rewind(); true; $changeStream->next()) { | ||
if ( ! $changeStream->valid()) { | ||
continue; | ||
} | ||
$event = $changeStream->current(); | ||
echo toJSON($event) . PHP_EOL; | ||
|
||
if ($event['operationType'] === 'invalidate') { | ||
break; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do...while
would be more appropriate.
for ($changeStream->rewind(); true; $changeStream->next()) { | |
if ( ! $changeStream->valid()) { | |
continue; | |
} | |
$event = $changeStream->current(); | |
echo toJSON($event) . PHP_EOL; | |
if ($event['operationType'] === 'invalidate') { | |
break; | |
} | |
} | |
$changeStream->rewind(); | |
do { | |
$changeStream->next(); | |
if ($changeStream->valid()) { | |
$event = $changeStream->current(); | |
echo toJSON($event) . PHP_EOL; | |
} | |
} while ($event['operationType'] !== 'invalidate'); |
Have you looked at our changestream example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of time and for consistency with examples on the already approved Monitor Data Changes page, I'll keep as is here. I can look into revising the examples as you've suggested here in a future piece of work. Thanks!
Ticket: https://jira.mongodb.org/browse/DOCSP-43912
c14727a
into
mongodb:php-standardization
Pull Request Info
PR Reviewing Guidelines
JIRA - https://jira.mongodb.org/browse/DOCSP-41973
Staging - https://deploy-preview-148--docs-php-library.netlify.app/read/
Self-Review Checklist