     (map clojure-object
          (.insert collection #^java.util.List (map db-object objs)))))
 
-(defn update [#^DBCollection collection query obj & [upsert? multi?]]
-  (clojure-object (.update collection
-                           #^DBObject (db-object query)
-                           #^DBObject (db-object obj)
-                           (boolean upsert?)
-                           (boolean multi?))))
+(defn update [#^DBCollection collection query obj & options]
+  (let [o? #(has-option? options %)]
+    (clojure-object (.update collection
+                             (db-object query)
+                             (db-object obj)
+                             (o? :upsert)
+                             (o? :multi)))))
 
-(defn upsert [#^DBCollection collection query obj]
-  (update collection query obj true))
+(defn upsert [collection query obj]
+  (update collection query obj :upsert))
 
-(defn update-all [#^DBCollection collection query obj]
-  (update collection query obj false true))
+(defn update-all [collection query obj]
+  (update collection query obj :multi))
 
 (defn include-keys [& keys]
   (apply merge (map (fn [k] {k 1}) (remove nil? keys))))

(defn ensure-index
  [#^DBCollection collection fields & options]
  (let [o? #(has-option? options %)]
    (.ensureIndex collection (db-object fields)
                  (o? :force) (o? :unique))))

(defn drop-index [#^DBCollection collection o]
  (.dropIndex collection #^DBObject (db-object o)))

  (.findOne collection (ObjectId. s)))

(defn distinct-values [#^DBCollection collection s]
  (seq (.distinct collection (name s))))

(defn delete [#^DBCollection collection obj]
  (.remove collection (db-object obj)))
