Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/map-reduce.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
mongo map reduce
|#

(defmacro $map-reduce (collection map reduce &key (query nil) (limit 0) (out nil)
(defmacro $map-reduce (collection map reduce &key (query nil) (limit nil) (out nil)
(keeptemp nil) (finalize nil) (verbose t))
"Run map reduce on the mongo server. map and reduce are either the names of the
javascript functions, created with defjs or defsrvjs or are function definitions in javascript.
Expand All @@ -16,8 +16,7 @@ When using :keeptemp t without specificing :out the collection is mr.<collection
(when ,finalize (kv "finalize" (jsdef ,finalize)))
(kv "out" (if ,out ,out (concatenate 'string "mr." ,collection)))
(kv "verbose" ,verbose)
(kv "limit" ,limit)
(kv "keeptemp" ,keeptemp)
(when ,limit (kv "limit" ,limit))
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • "keeptemp" is apparently no longer supported in calls to MongoDB's mapReduce.
  • "limit" is apparently no longer allowed to be zero in calls to MongoDB's mapReduce.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, 0 is "true" in CL, so perhaps (unless (zerop limit) ...) or (when (> limit 0) ...) ?

(kv "query" ,query))))

(defun mr.p (results)
Expand Down