Questions tagged [monger]

Monger is a Clojure MongoDB client

Monger is a Clojure MongoDB client

51 questions
0
votes
1 answer

How can I stream GridFS files to web clients in Clojure/Monger?

I have a web app using Clojure, Clojurescript, and Monger. Documents are uploaded and stored in Mongo via GridFS. The same files can be requested for download; at the moment this is accomplished by writing the file to (the server's) disk and serving…
WorldsEndless
  • 1,493
  • 1
  • 15
  • 27
0
votes
1 answer

Clojure - avoid duplicated code with monger requests

I am using Clojure and Monger It works fine, and I group functions by the collection they relate to. Therefore, every file begins like this : (ns img-cli.model.mycollectionname (:require [monger.core :as mg] …
nha
  • 17,623
  • 13
  • 87
  • 133
0
votes
1 answer

Why monger only update one record instead all the records in the list

I have a function that takes in list of entry and save it to mongo using monger. What is strange is that only the one record will be updated and the rest ignored unless I specify multi:true. I don't understand why the multi flag is necessary for…
Teo Choong Ping
  • 12,512
  • 18
  • 64
  • 91
0
votes
0 answers

How to operate on batches in monger?

I'm querying a mongo collection from monger doing something like this: (with-collection "my-collection" (find {}) (limit 1000) (batch-size 10)) I'm then iterating over the resulting cursor like this: (doseq [item cursor] (do-something…
sthomps
  • 4,480
  • 7
  • 35
  • 54
0
votes
2 answers

How can I execute a Mongo `forEach` (or run my own JS) with Monger?

I'm using Monger to connect to Mongo. I want to run db.collection.find().forEach(function(x) { db.collection-two.insert(...) }) I can't see a relevant 'for each' entry in the Monger docs or a way to pass in JavaScript to insert into another…
Joe
  • 46,419
  • 33
  • 155
  • 245
0
votes
2 answers

Where to put monger connection in Compojure app for Heroku?

I created a compojure app using lein new compojure mongotest with lein 2.0, and a Procfile web: lein ring server-headless $PORT. This worked fine, but now when I add (def mongolab-url (System/getenv "MONGOLAB_URI")) (println…
Dax Fohl
  • 10,654
  • 6
  • 46
  • 90
1 2 3
4