Permalink
Browse files

fixes invalid index key

  • Loading branch information...
1 parent f21fc29 commit fed6df5d6251e0b6b048314c7249ab746daf3662 @literalice committed Dec 11, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/groovy/com/monochromeroad/grails/plugins/mongo/cia/MongoDatastore.groovy
@@ -55,9 +55,9 @@ class MongoDatastore extends org.grails.datastore.mapping.mongo.MongoDatastore {
final MongoCollection mappedForm = classMapping.getMappedForm();
if (mappedForm != null) {
for (Map compoundIndex : mappedForm.getCompoundIndices()) {
- if (compoundIndex.indexAttributes) {
+ if (compoundIndex.indexAttributes instanceof Map) {
DBObject options = new BasicDBObject(compoundIndex.indexAttributes as Map)
- compoundIndex.indexAttributes = null
+ compoundIndex.remove("indexAttributes")
DBObject indexDef = new BasicDBObject(compoundIndex);
collection.ensureIndex(indexDef, options);
} else {

0 comments on commit fed6df5

Please sign in to comment.