is there a way to hand in several lines of Javascript to Monger?
22 views
Skip to first unread message
lawrenc...@gmail.com
unread,
May 13, 2013, 2:44:28 PM5/13/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to clojure...@googlegroups.com
I often have to generate reports -- pulling data out of Mongo, and then adding it up somehow. When I am at the terminal, I sometimes start the mongo shell and generate a report by writing serval lines of Javascript: a find() query, and then maybe a loop that goes over the results and calculates something, perhaps adding and dividing something.
Is there a way I can hand in several lines of Javascript code to Monger, with Monger passing it along to Mongo and getting a calculated result?
Michael Klishin
unread,
May 13, 2013, 2:56:47 PM5/13/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to clojure...@googlegroups.com
In order to do the same thing, I used Scriptjure
(https://github.com/arohner/scriptjure) to generate JS code from
Clojure code. This was kind of insano and I recommend it only if you
are nuts and/or have to turn a Clojure data structure into a
map/reduce command for MongoDB.