Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
introduce_pattern_matching_with_mongo-clarify
Search
morihirok
May 09, 2019
Programming
160
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
introduce_pattern_matching_with_mongo-clarify
Hello hey for Engineers vol.3で発表した内容です。
morihirok
May 09, 2019
More Decks by morihirok
See All by morihirok
Back into Monolith, Back into Rails
morihirok
0
140
Sidekiq その前に:Webアプリケーションにおける非同期ジョブ設計原則
morihirok
18
12k
Ruby on Rails の楽しみ方
morihirok
12
7.5k
RubyKaigi で得た課題解決法・美意識・モチベーション
morihirok
0
940
混沌とした例外処理とエラー監視に秩序をもたらす
morihirok
24
5.1k
継続的にRailsアプリを開発する上で早めにやっておきたいこと
morihirok
11
3.8k
1日5分!子育て中もインプットを続ける工夫
morihirok
4
1.4k
rarray_value.pdf
morihirok
0
2.1k
失敗しても大丈夫!ひとりWebサービスのすゝめ
morihirok
2
600
Other Decks in Programming
See All in Programming
TanStack Vue Query と Pinia Colada から学ぶ非同期状態の型設計
aoshi
0
610
Crash Auto Pipelines
veronikapj
1
350
우리의 Nitro Modules는 당신의 Turbo Modules보다 아름답다
l2hyunwoo
0
250
Lambda durable functionsでHuman in the Loopを楽に…楽に……
har1101
2
280
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Kaigi on Rails 2026, Tokyo, Japan
marcoroth
2
410
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
300
Distance field of Julia set
kinakomoti321
0
150
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
4
3.2k
社内AIエージェント「Askワンバン」における コストチューニングの取り組み
t0yohei
0
150
AWS CDKを理解するために公式の定義を深掘って解説してみる / Understanding AWS CDK by Digging into Its Official Definition
akihisaikeda
2
260
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
1.2k
AI-Powered Domain-Driven Design
ziobrando
0
390
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
41
2.8k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
What does AI have to do with Human Rights?
axbom
PRO
1
2.5k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.9k
Context Engineering - Making Every Token Count
addyosmani
9
1.3k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
600
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
680
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
660
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Utilizing Notion as your number one productivity tool
mfonobong
4
640
Transcript
Introduce Pattern matching with mongo-clarify Hello hey for Engineers vol.3
@_morihirok
About me • Github: morihirok • Twitter: @_morihirok • STORES.jp
ϓϩμΫτਪਐνʔϜ
Ruby 2.7ͷ৽ػೳ Pattern matching͕ ໘നͦ͏
3VCZ,BJHJ1BUUFSONBUDIJOH/FXGFBUVSFJO3VCZΑΓҾ༻ IUUQTTQFBLFSEFDLDPNL@UTKQBUUFSONBUDIJOHOFXGFBUVSFJOSVCZEPU
3VCZ,BJHJ1BUUFSONBUDIJOH/FXGFBUVSFJO3VCZΑΓҾ༻ IUUQTTQFBLFSEFDLDPNL@UTKQBUUFSONBUDIJOHOFXGFBUVSFJOSVCZEPU
ͬͯΈ͍ͨͷͰ Կ͔࡞Ζ͏
.POHP%#YΠϯσοΫεੜલޙͷFYQMBJO ݁ՌΛಡΉΑΓҾ༻ IUUQTCMPHNLOLJTLDPNNPOHPECJOEFYFYQMBJO
MongoDBͷexplain গ͠ಡΈͮΒ͍…
MongoDBͷexplain݁Ռͷ αϯϓϧ > db.items.find({price: 119}).explain("executionStats") { "queryPlanner" : { "plannerVersion"
: 1, "namespace" : "sample_db.items", "indexFilterSet" : false, "parsedQuery" : { "price" : { "$eq" : 119 } }, "winningPlan" : { "stage" : "COLLSCAN", "filter" : { "price" : { "$eq" : 119 } શͯ+40/Ͱදݱ͞ΕΔ
͜ΕΛಡΈ͘͢ දࣔͤ͞Δͷʹ Pattern matching͕ ศརͦ͏
ͱ͍͏͜ͱͰ࡞ͬͨͷ͕͜Ε FYQMBJOͷ+40/Λ ͍͍۩߹ʹ.BSLEPXOͷ ςʔϒϧʹม͢Δ
ΠϯσοΫε͕ޮ͍ͯͳ͍ͱ͖ͷ explain݁Ռ ͕͜͜z$0--4$"/zʹͳΔ
͜͏ॻ͚Δ ͕͜͜z$0--4$"/zʹͳΔ
ΠϯσοΫε͕ޮ͍͍ͯΔͱ͖ͷ explain݁Ռ ͕͜͜z'&5$)zʹมΘΔ ͕͜͜z*94$"/zʹͳΔ ͜͜ʹΠϯσοΫε໊͕ೖΔ
͜͏ॻ͚Δ ͕͜͜z'&5$)zʹมΘΔ ͕͜͜z*94$"/zʹͳΔ ͜͜ʹΠϯσοΫε໊͕ೖΔ
͜͏ॻ͚Δ มΛόΠϯυͰ͖Δ ͜͜ʹΠϯσοΫε໊͕ೖΔ
࠷ऴతʹ͜͏ͳΔ
STORES.jpͰ ͍͍ײ͡ʹ͑ͦ͏
ൃੜ
Ruby 2.7(trunk)͡Όͳ͍ͱ ͑ͳ͍
Pattern matchingແ͠Ͱ ॻ͖͑Δ
Pattern matchingແ͠Ͱ ॻ͖͑Δ
কདྷతʹ ॏๅ͞Εͦ͏ͳ༧ײ
ࠓͷίʔυͪ͜Β͔Β IUUQTHJUIVCDPNNPSJIJSPLNPOHPDMBSJGZ