michaelklishin/monger — pull request #62 by timgluz (2013-09-21 18:23:52+00:00)
Title: Enhancements for tweaking options of dbCursor

Hi,

i enhanced the way of tweaking options of the DBCursor by adding additional helper namespace `monger.cursor` and changed `options`-partial, which now uses multimethod add-options.

Now, it's possible to change one or more parameter once by using Clojure datatypes.

```clojure
;;; using query DSL
(with-collection "products"
...
(options {:notimeout true, :slaveok false}) ;;where keyword matches Bytes/QUERYOPTION_*
(options [:notimeout :slaveok])
(options com.mongodb.Bytes/QUERYOPTION_NOTIMEOUT) ;; support for previous interface
(options :notimeout)
...
```

You'll notice that there is a little a bit more helper-functions than i mentioned.
These function are useful when you need low-level access to cursor - with that namespace, it's possible to create db-cursor, manipulate options and format output of cursor, which enables to replicate current low-level finders find/find-map/find-seq.
That way was possible to keep low-level finders untouched.

ps: i noticed that documentation about [Querying](http://clojuremongodb.info/articles/querying.html) still misses information about tweaking query's options. I'm going to fix that issue too.