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.4k
RubyKaigi で得た課題解決法・美意識・モチベーション
morihirok
0
910
混沌とした例外処理とエラー監視に秩序をもたらす
morihirok
24
5k
継続的にRailsアプリを開発する上で早めにやっておきたいこと
morihirok
11
3.7k
1日5分!子育て中もインプットを続ける工夫
morihirok
4
1.4k
rarray_value.pdf
morihirok
0
2k
失敗しても大丈夫!ひとりWebサービスのすゝめ
morihirok
2
590
Other Decks in Programming
See All in Programming
Hello, Hiroshima Geospatial Data! — Exploring DoboX with Python
ra0kley
0
180
typoなんかねぇよ
raspython3
0
680
「AI時代、配布するPythonコードをどう守るか: 難読化の実験と判断軸」 #PyconJP2026
pkshadeck
PRO
2
190
モバイル交通系ICへのチャージ実例から考える、クロスプラットフォーム開発におけるiOS実機テスト設計とCI運用
yusuga
1
260
AIとGame Jamで、ゲームを完成させた話
takahirosaeki
0
110
AWS Step Functions 大規模並列の壁を越える / jaws-sonic-2026-niigata-step-functions
kasacchiful
PRO
1
430
ハーネス設計入門 〜プロンプト、コンテキストの次〜
kinopeee
55
37k
go-spidermonkeyでAIエージェントのCode Modeを実装する
syumai
3
1.5k
Building an Out-of-Order CPU
latte72
1
740
ALB ログから Trace を気合で繋げる技術
fohte
7
880
自分的「カンファレンスの楽しみ方」
syumai
0
200
RSSとCodexを使ってX投稿自動化してみた
ochtum
0
110
Featured
See All Featured
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.2k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
450
Docker and Python
trallard
47
4.2k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
400
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Become a Pro
speakerdeck
PRO
31
6.2k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
680
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
710
A Tale of Four Properties
chriscoyier
163
24k
Skip the Path - Find Your Career Trail
mkilby
1
220
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