-
Type: Task
-
Resolution: Cannot Reproduce
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
On my course model, newly specified:
index(
{ stub: 1, openlibrary: 1, title: 1, description: 1 })
ran
rake db:mongoid:create_indexes
twice. Now...
2.2.0 :001 > Course.where(stub:"bio_oa_ll_100").first
=> nil
2.2.0 :003 > Course.where(stub:"bio_oa_ll_100")
=> #<Mongoid::Criteria
selector:
options: {}
class: Course
embedded: false>
2.2.0 :004 > Course.where(stub:"bio_oa_ll_100").count
=> 1
2.2 .0 :005 > Course.where(stub:"bio_oa_ll_100").first
=> nil
2.2.0 :006 > Course.where(stub:"bio_oa_ll_100").all
=> #<Mongoid::Criteria
selector: {"stub"=>"bio_oa_ll_100"}
options: {}
class: Course
embedded: false>
2.2.0 :007 > Course.where(stub:"bio_oa_ll_100").entries
=> [#<Course _id: 53876d686f70650c4d000000 [........]
What on earth?
Fixed with this:
rake db:mongoid:remove_indexes
Maybe amend the behavior of the first rake command (create_indexes) - should this even be possible? Wrecked my site for a few minutes.