-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
Hi,
rake db:mongoid:create_indexes does not create the defined indexes correctly in 3.0.0.rc.
In my model I use:
index(
{ project_id: 1, email: 1 }, unique: true)
index(
)
index(
)
rake db:mongoid:create_indexes shows the following output in the console, which is wrong:
Creating indexes on: Subscriber for: {:project_id=>1, :email=>1}, {:created_at=>-1}, {:active=>1, :next_mailing=>-1}.
And in MongoDB the following indexes are created:
db.subscribers.getIndexes()
[
{
"v" : 1,
"key" :
,
"ns" : "test.subscribers",
"name" : "id"
},
{
"v" : 1,
"key" :
,
"unique" : true,
"ns" : "test.subscribers",
"name" : "project_id_1_email_1"
},
{
"v" : 1,
"key" :
,
"ns" : "test.subscribers",
"name" : "created_at_-1"
},
{
"v" : 1,
"key" :
,
"ns" : "test.subscribers",
"name" : "active_1_next_mailing_-1"
}
]
Am I defining indexes in my models the wrong way?
Thanks and cheers