Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

72 lines (40 sloc) 2.133 kb

Changes between 1.0.0-beta1 and 1.0.0-beta2

3-arity of monger.collection/find-one-as-map now takes a vector of fields

3-arity of monger.collection/find-one-as-map now takes a vector of fields instead of keywordize to better fit a more commonly needed case.

;; 3-arity in 1.0.0-beta1
(monger.collection/find-one-as-map "documents" { :first_name "John" } false)
;; 3-arity in 1.0.0-beta2
(monger.collection/find-one-as-map "documents" { :first_name "John" } [:first_name, :last_name, :age])

If you need to use keywordize, use 4-arity:

(monger.collection/find-one-as-map "documents" { :first_name "John" } [:first_name, :last_name, :age] false)

Query DSL has a way to specify if fields need to be keywordized

It is now possible to opt-out of field keywordization in the query DSL:

(with-collection coll
  (find {})
  (limit 3)
  (sort { :population -1 })
  (keywordize-fields false))

the default value is still true, field names will be converted to keywords.

monger.collection/find-by-id and /find-map-by-id fail fast when id is nil

monger.collection/find-by-id and /find-map-by-id now will throw IllegalArgumentException when id is nil

monger.collection/find-map-by-id no longer ignore fields argument

monger.collection/find-map-by-id no longer ignore fields argument. Contributed by Toby Hede.

Meet monger.db and monger.command

monger.db namespace was added to perform operations like adding users or dropping databases. Several functions from monger.core will eventually be moved there, but not for 1.0.

monger.command namespace includes convenience methods for issuing MongoDB commands.

Both are contributed by Toby Hede.

New convenience functions: monger.collection/update-by-id, /remove-by-id

monger.collection/update-by-id is a new convenience function for updating a single document with given ObjectId. monger.collection/remove-by-id is its counterpart for removing documents.

monger.core/get-db-names

monger.core/get-db-names returns a set of databases. Contributed by Toby Hede.

Jump to Line
Something went wrong with that request. Please try again.