diff --git a/src/clojure/monger/collection.clj b/src/clojure/monger/collection.clj index 8569576..59ff4b0 100644 --- a/src/clojure/monger/collection.clj +++ b/src/clojure/monger/collection.clj @@ -422,10 +422,10 @@ (.createIndex (.getCollection db (name coll)) (as-field-selector keys) (to-db-object options))) - ([^DB db ^String coll ^Map keys ^String name unique?] + ([^DB db ^String coll ^Map keys ^String index-name unique?] (.createIndex (.getCollection db (name coll)) (as-field-selector keys) - name + index-name unique?))) diff --git a/test/monger/test/indexing_test.clj b/test/monger/test/indexing_test.clj index 1c591a4..7211182 100644 --- a/test/monger/test/indexing_test.clj +++ b/test/monger/test/indexing_test.clj @@ -26,6 +26,8 @@ (mc/ensure-index db collection (array-map "language" 1)) (mc/drop-indexes db collection) (mc/ensure-index db collection (array-map "language" 1) {:unique true}) + (mc/drop-indexes db collection) + (mc/ensure-index db collection (array-map "language" 1) "index-name" true) (mc/drop-indexes db collection))) (deftest ^{:indexing true :time-consuming true} test-ttl-collections