Last active
March 22, 2024 23:45
-
-
Save jb08/d0439c70976d1dd1df3a587e6736b30d to your computer and use it in GitHub Desktop.
Mongoid subclass indicies not created in Atlas
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Animal | |
field :color, type: String | |
field :mammal, type: Boolean | |
... | |
index({ mammal: 1, color: 1 }, background: true) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Bear < Animal | |
include Mongoid::Document | |
field :hibernates, type: Boolean | |
field :favorite_honey_type, type: String | |
index({ mammal: 1, favorite_honey_type: 1 }, background: true) ### this index is not showing up in Atlas | |
### is adding index line in file the "correct" way to add a new index? or via Atlas? or both? | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment