Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
introduce_pattern_matching_with_mongo-clarify
Search
morihirok
May 09, 2019
Programming
150
0
Share
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
91
Sidekiq その前に:Webアプリケーションにおける非同期ジョブ設計原則
morihirok
18
11k
Ruby on Rails の楽しみ方
morihirok
12
7.1k
RubyKaigi で得た課題解決法・美意識・モチベーション
morihirok
0
800
混沌とした例外処理とエラー監視に秩序をもたらす
morihirok
24
4.8k
継続的にRailsアプリを開発する上で早めにやっておきたいこと
morihirok
11
3.6k
1日5分!子育て中もインプットを続ける工夫
morihirok
4
1.3k
rarray_value.pdf
morihirok
0
1.9k
失敗しても大丈夫!ひとりWebサービスのすゝめ
morihirok
2
560
Other Decks in Programming
See All in Programming
Server-Side Kotlin LT大会 vol.18 [Kotlin-lspの最新情報と Neovimのlsp設定例]
yasunori0418
1
180
AIベース静的検査器の偽陽性率を抑える工夫3選
orgachem
PRO
3
360
Back to the roots of date
jinroq
0
390
Going Multiplatform with Your Android App (Android Makers 2026)
zsmb
2
450
VueエンジニアがReactを触って感じた_設計の違い
koukimiura
0
180
(Re)make Regexp in Ruby: Democratizing internals for the JIT
makenowjust
3
630
ふりがな Deep Dive try! Swift Tokyo 2026
watura
0
230
AI時代のPhpStorm最新事情 #phpcon_odawara
yusuke
0
200
GitHubCopilotCLIをはじめよう.pdf
htkym
0
260
〜バイブコーディングを超えて〜 チームで実験し続けたAI駆動開発
tigertora7571
0
160
t *testing.T は どこからやってくるの?
otakakot
1
710
Lightning-Fast Method Calls with Ruby 4.1 ZJIT / RubyKaigi 2026
k0kubun
3
1.2k
Featured
See All Featured
How to make the Groovebox
asonas
2
2.1k
What's in a price? How to price your products and services
michaelherold
247
13k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.5k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
70
39k
How to Ace a Technical Interview
jacobian
281
24k
Chasing Engaging Ingredients in Design
codingconduct
0
170
The untapped power of vector embeddings
frankvandijk
2
1.7k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.2k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
53k
Tell your own story through comics
letsgokoyo
1
900
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