运行" repairDatabase"与蒙格?

时间:2017-08-14 05:34:04

标签: mongodb clojure monger

是否可以执行" repairDatabase"命令Monger?如果是这样的话?

2 个答案:

答案 0 :(得分:1)

你可以这样做:

(: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})))))

答案 1 :(得分:0)

我发现你可以做到:

(monger.core/command db {:repairDatabase 1})