Re: geoNear

Showing 1-9 of 9 messages
Re: geoNear Michael Klishin 9/19/12 1:19 AM


On Sep 19, 10:20 am, biscarch <avantdigita...@gmail.com> wrote:
> Has anyone run a geoNear command using Monger? My implementation seems to
> result in the near field being read as a command.
>
> Here is my command:
>
> {:geoNear "collection" :near 50 :test 430 :num 10}

Please post full code example (that includes the function call).

MK
Re: geoNear biscarch 9/19/12 4:39 AM
Here is the full noir route and relevant requires:

(:require [clojure.data.json :as js]
              [monger.core :as mg]
              )

(defpage "/bars" []
  (let [bars (mg/command (mg/get-db "test") {:geoNear "bars" :near 50 :test 430 :num 10})]
  (response/status 200 (js/json-str bars))))

and the error returned from mongo (that makes it all the way back to curl):

{"serverUsed":"flame.mongohq.com\/ip:port","errmsg":"no such cmd: near","bad cmd":{"near":50,"test":430,"num":10,"geoNear":"bars"},"ok":0.0}%   

I was using :test 430 to check the ordering of parameters in the error. It is the same with or without it.
Re: [clojure-mongodb] Re: geoNear Michael Klishin 9/19/12 5:19 AM
2012/9/19 biscarch <avantdi...@gmail.com>

I was using :test 430 to check the ordering of parameters in the error. It is the same with or without it.

try with (sorted-map :geoNear "bars" :near 50 :test 430 :num 10)

--
MK


Re: geoNear biscarch 9/19/12 6:05 AM
That worked wonderfully. Thank you.

Full command is now:
(mg/command (mg/get-db "test") (sorted-map :geoNear "bars" :near [50 50] :num 10))

On Tuesday, September 18, 2012 11:20:46 PM UTC-7, biscarch wrote:
Has anyone run a geoNear command using Monger? My implementation seems to result in the near field being read as a command.

Here is my command:

{:geoNear "collection" :near 50 :test 430 :num 10}
Re: [clojure-mongodb] Re: geoNear Michael Klishin 9/19/12 6:26 AM
2012/9/19 biscarch <avantdi...@gmail.com>

That worked wonderfully. Thank you.

Thank *you* for bringing this up. We will update the docs (and monger.command, monger.collection functions) to recommend
Re: [clojure-mongodb] Re: geoNear Vesa 11/18/14 8:28 PM
Hi,


On Wednesday, September 19, 2012 8:27:34 PM UTC+7, Michael Klishin wrote:
Thank *you* for bringing this up. We will update the docs (and monger.command, monger.collection functions) to recommend
and use sorted maps.

The example in [1] is (sorted-map geoNear db "bars" :near 50 :test 430 :num 10) which seems incorrect (geoNear, db)

[1] https://github.com/michaelklishin/monger/blob/ef539f48c8c6a880c7c4e0ced2eff7d4631a0cb6/src/clojure/monger/core.clj#L178


Re: [clojure-mongodb] Re: geoNear Michael Klishin 11/19/14 7:15 AM
On 19 November 2014 at 15:12:54, Vesa (vesa.po...@leonidasoy.fi) wrote:
> The example in [1] is (sorted-map geoNear db "bars" :near 50  
> :test 430 :num 10) which seems incorrect (geoNear, db)
>  
> [1] https://github.com/michaelklishin/monger/blob/ef539f48c8c6a880c7c4e0ced2eff7d4631a0cb6/src/clojure/monger/core.clj#L178  

It should be  , yes.
--  
@michaelklishin, github.com/michaelklishin
unk...@googlegroups.com 11/19/14 6:02 PM <This message has been deleted.>
unk...@googlegroups.com 11/19/14 6:05 PM <This message has been deleted.>