-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Allow delete and index actions with a document ID #12606
Merged
ycombinator
merged 17 commits into
elastic:master
from
bestpath:feature/allow-index-and-delete-with-id
May 6, 2020
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
7ac1280
Add `op_type` meta key for delete and index operations with a documen…
bestpath-gb a054ab5
Add note on why `obj` can be nil.
bestpath-gb e32ca09
Refactor and extract consts.
bestpath-gb 8713bd6
Don't include metadata prefix in key.
bestpath-gb fa44486
Stop appending `nil` else it ends up in the body.
bestpath-gb 1245360
Error when trying to delete with no _id.
bestpath-gb 722dd71
Remove incorrect detail in comment.
bestpath-gb 932f954
Add unit test for new op_type meta key.
bestpath-gb 99c2bf2
No longer required.
bestpath-gb 0ef2a12
Return error to caller.
bestpath-gb dc0a7b1
Fail event if op_type is no string.
bestpath-gb 40a22d9
Use consts in error.
bestpath-gb a541783
Replace assert with require.
bestpath-gb ef3883b
Fail instead of panic.
bestpath-gb 140e74f
Change missed assert calls to require.
bestpath-gb d084e89
Simplify GetMetaStringValue.
bestpath-gb 8ddf373
Ignore err as key may not exist.
bestpath-gb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Nit: The function can be simplified to this:
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.
how about (requires no alloc):
All in all I'd prefer to keep the interface of
Event
as small as possible and provide helpers as functions instead of methods.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.
This is even better. \o/
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.
Thanks for the feedback. I've used the version from @urso . Nice to see this level of attention to detail!