doctrine/mongodb-odm — Issue #225: SchemaManager::prepareIndexes() should allow unmapped fields
Author: jmikola
Created: 2012-01-08 05:59:20+00:00
State: open

Per my comment in dd10565b70e2a82a302264603a6b909eebc49b29:

[Multikey](http://www.mongodb.org/display/DOCS/Multikeys) indexes on fields within an array of embedded objects is no longer supported. For instance, it's not possible to apply an index to `tags.name` for the following document schema:

``` json
{ tags: [ { name: 'foo', weight: 1 }, { name: 'bar', weight: 2 } ] }
```

I understand @tecbot's intentions beyond the series of commits adding field name preparation in various places, but the trade-off has been causing ODM to throw exceptions whenever unmapped fields are referenced. A previous problem (since fixed in #216) was indexing discriminator fields.

Slightly off-topic: IMO this problem extends beyond SchemaManager. I'd love the option to use raw field names in queries, indexes, etc. Does anyone else see value in this?