|
When connected to a mongos, creating an index on a collection in a non-existent database throws an error.
Here is the output from mongosniff using the ruby driver:
127.0.0.1:63099 -->> 127.0.0.1:61017 ruby-driver.$cmd 168 bytes id:14 20
|
query: { createIndexes: "grid.chunks", indexes: [ { key: { files_id: 1, n: 1 }, unique: true, name: "files_id_1_n_1" } ] } ntoreturn: -1 ntoskip: 0
|
127.0.0.1:61017 <<-- 127.0.0.1:63099 106 bytes id:89ba 35258 - 20
|
reply n:1 cursorId: 0
|
{ code: 60, ok: 0.0, errmsg: "database ruby-driver not found" }
|
I've confirmed that an error is not thrown when connected to a single mongod:
127.0.0.1:63603 -->> 127.0.0.1:27017 ruby-driver.$cmd 142 bytes id:2 2
|
query: { createIndexes: "test", indexes: [ { key: { name: 1 }, unique: true, name: "name_1" } ] } ntoreturn: -1 ntoskip: 0
|
127.0.0.1:27017 <<-- 127.0.0.1:63603 129 bytes id:1 1 - 2
|
reply n:1 cursorId: 0
|
{ createdCollectionAutomatically: true, numIndexesBefore: 1, numIndexesAfter: 2, ok: 1.0 }
|
|