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

Update: Exclude fields in Change Streams #24

Closed
wants to merge 5 commits into from

Conversation

KenFujimoto12
Copy link
Collaborator

@KenFujimoto12 KenFujimoto12 commented May 12, 2022

内容

Change Streams内のfulldocumentフィールドで、除外を可能にしたいという要望がありましたので、実装しました。
ローカルにて挙動確認済み。

e.g.
環境変数

MONGO_WATCH_PIPELINE_EXCLUDE_CS_FIELD=fullDocument.nest.nest1,fullDocument.firstName

投入データ

db.test.insert({"firstName":"ken","lastName":"fujimoto","gender":"male","age":"27","address":"tokyo","number":["0","1","2","3","4","5","6","7","8","9","10"],"nest":{"nest1":{"aaa":"AAA"},"nest2":{"bbb":"BBB"}}})

結果

{"logType":"changeStream","cs":{"_id":{"_data":"xxx"},"operationType":"insert","clusterTime":"2022-05-12T11:31:13+09:00","ns":{"coll":"test","db":"test"},"fullDocument":{"_id":"xxx","address":"tokyo","age":"27","gender":"male","lastName":"fujimoto","nest":{"nest2":{"bbb":"BBB"}},"number":["0","1","2","3","4","5","6","7","8","9","10"]},"documentKey":{"_id":"xxx"},"updateDescription":null}}

対象issues

#20

@KenFujimoto12 KenFujimoto12 requested a review from syama666 May 12, 2022 03:45
README.md Outdated
MONGO_WATCH_PIPELINE_EXCLUDE_CS_FIELD

e.g.
MONGO_WATCH_PIPELINE_EXCLUDE_CS_FIELD=fulldocument.<Unnecessary fields>,fulldocument.<Unnecessary fields>
Copy link

@sekino sekino May 12, 2022

Choose a reason for hiding this comment

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

こちら、fulldocument -> fullDocument のtypoかもしれません

Copy link

Choose a reason for hiding this comment

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

あと、実際に実装ないで参照している環境変数は MONGO_WATCH_PIPELINE_EXCLUDE_CS_FULLDOCUMENT_FIELD のようです

@sonarcloud
Copy link

sonarcloud bot commented May 17, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

4.8% 4.8% Coverage
0.0% 0.0% Duplication

@KenFujimoto12
Copy link
Collaborator Author

不要になったためcloseします。

@KenFujimoto12 KenFujimoto12 deleted the feature/add-pipeline-in-watch branch January 19, 2023 01:26
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