From 0db4bc6e11cc38ec6ad35623b77686621b64a7f1 Mon Sep 17 00:00:00 2001 From: "Michael S. Klishin" Date: Tue, 22 May 2012 18:46:15 +0400 Subject: [PATCH] Minor docstring improvements --- src/monger/collection.clj | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/monger/collection.clj b/src/monger/collection.clj index 7e49122..44c7fbf 100644 --- a/src/monger/collection.clj +++ b/src/monger/collection.clj @@ -443,12 +443,14 @@ (defn ensure-index "Creates an index on a set of fields, if one does not already exist. - ensureIndex in Java driver is optimized and is inexpensive if the index already exists. + This operation is optimized in the Java driver and is inexpensive in the case when an index already exists. EXAMPLES - (monger.collection/ensure-index collection { \"language\" 1 }) - + ;; create a regular index + (monger.collection/ensure-index \"documents\" { \"language\" 1 }) + ;; create a unique index + (monger.collection/ensure-index \"pages\" { :url 1 } {:unique true}) " ([^String collection, ^Map keys] (let [coll ^DBCollection (.getCollection monger.core/*mongodb-database* collection)]