Mongoid Ate My
Homework
10 quick gotchas from using mongoid in production.
- Jude
I’m @slowjud on everything
(twitter/github)
I work at SplitIt.
We run www.betterbills.com
We run www.betterbills.com
We ru...
Gratuitous bike porn
Now for my talk
MongoDB is not
relational
MongoDB only uses
one index per query
Nil does not unset a
field
Nil is not the opposite
of exist
BigDecimal type sorts
alphabetically
Embedded objects must
have an embedded_in
declared
Indexes don’t get created
on embedded objects
Scopes should go on
the parent object
Callbacks on embedded
objects are not run by
default
Don’t try and perform two
atomic operations on the
same field in the same call
Questions?
Gists
Slides: http://www.slideshare.net/slowjud/mongoid-ate-my-homework
The good models: https://gist.github.com/slowjud/9...
Thank You
Mongoid ate my homework
Mongoid ate my homework
Mongoid ate my homework
Mongoid ate my homework
Mongoid ate my homework
Mongoid ate my homework
Mongoid ate my homework
Mongoid ate my homework
Mongoid ate my homework
Upcoming SlideShare
Loading in...5
×

Mongoid ate my homework

207

Published on

My talk about Mongoid for RORO Syd.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
207
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Mongoid ate my homework

  1. 1. Mongoid Ate My Homework 10 quick gotchas from using mongoid in production. - Jude
  2. 2. I’m @slowjud on everything (twitter/github) I work at SplitIt. We run www.betterbills.com We run www.betterbills.com We run www.betterbills.com We run www.betterbills.com
  3. 3. Gratuitous bike porn
  4. 4. Now for my talk
  5. 5. MongoDB is not relational
  6. 6. MongoDB only uses one index per query
  7. 7. Nil does not unset a field
  8. 8. Nil is not the opposite of exist
  9. 9. BigDecimal type sorts alphabetically
  10. 10. Embedded objects must have an embedded_in declared
  11. 11. Indexes don’t get created on embedded objects
  12. 12. Scopes should go on the parent object
  13. 13. Callbacks on embedded objects are not run by default
  14. 14. Don’t try and perform two atomic operations on the same field in the same call
  15. 15. Questions?
  16. 16. Gists Slides: http://www.slideshare.net/slowjud/mongoid-ate-my-homework The good models: https://gist.github.com/slowjud/9476959 The bad models: https://gist.github.com/slowjud/9476981 All of the queries: https://gist.github.com/slowjud/9477341
  17. 17. Thank You
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×