From ddf3156c8e89645f2adab7f8f7ed170ef21e374a Mon Sep 17 00:00:00 2001 From: "Michael S. Klishin" Date: Sun, 16 Oct 2011 16:02:13 +0400 Subject: [PATCH] Load mapper function from .js resource --- test/monger/test/collection.clj | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/monger/test/collection.clj b/test/monger/test/collection.clj index deb74d3..88daa1e 100644 --- a/test/monger/test/collection.clj +++ b/test/monger/test/collection.clj @@ -8,7 +8,8 @@ [clojure stacktrace] [monger.collection :as mgcol] [monger.result :as mgres] - [monger.conversion :as mgcnv]) + [monger.conversion :as mgcnv] + [monger.js :as js]) (:use [clojure.test])) (monger.core/connect!) @@ -504,9 +505,7 @@ ;; (let [collection "widgets" - mapper "function() { - emit(this.state, this.price * this.quantity) - }" + mapper (js/load-resource "resources/mongo/js/mapfun1.js") reducer "function(key, values) { var result = 0; values.forEach(function(v) { result += v });