On Friday, February 28, 2014 5:04:59 PM UTC+1, Michael Klishin wrote:
>
> Monger's API follows MongoDB shell. CongoMongo invents a completely new 
> API. I'll let you decide which one is easier to understand.
>

How is CongoMongo inventing a completely new API?
Taking an example adapted from Monger's documentation 
(http://clojuremongodb.info/articles/querying.html#using_mongodb_query_operators),
 
what in Monger would be...

(monger.collection/find "products" { :price_in_subunits { "gt" 1200 "lte" 
4000 } })

in CongoMongo would be...

(somnium.congomongo/fetch :products :where { :price_in_subunits { :$gt 1200 
:$lte 4000 } })

and in the Mongo shell...

db.products.find( { price_in_subunits: { $gt: 1200 $lte: 4000 } )


Ok, now that I've written it, I see that CongoMongo changes `find` with 
`fetch` for example. Is that what you're referring to when saying that 
CongoMongo invents a completely new API?

Good to know that the DSL in Monger is completely optional.

Cheers,
Xavi

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to