0

Is it possible to execute the "repairDatabase" command with Monger? If so how?

Johan
  • 37,479
  • 32
  • 149
  • 237

2 Answers2

1

you can do like this:

(:require [clojure.test :refer :all]
          [monger.core :as mc]))

(deftest ^:focused repair-db-test
  (let [conn (mc/connect)
        db (mc/get-db conn "test-db")]
   (is (= {"ok" 1.0}
          (mc/command db {:repairDatabase 1})))))
Minh Tuan Nguyen
  • 1,026
  • 8
  • 13
0

I found out that you can just do:

(monger.core/command db {:repairDatabase 1})
Johan
  • 37,479
  • 32
  • 149
  • 237