From 1d54e00a4d165770a232a552f0bb6c690763473b Mon Sep 17 00:00:00 2001 From: "Michael S. Klishin" Date: Sat, 12 May 2012 07:44:40 +0400 Subject: [PATCH] Change log update, copyright header update --- ChangeLog.md | 14 ++++++++++++++ src/monger/collection.clj | 1 + 2 files changed, 15 insertions(+) diff --git a/ChangeLog.md b/ChangeLog.md index 7ec069d..c8a4a7f 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,19 @@ ## Changes between 1.0.0-beta5 and 1.0.0-beta6 +### find-and-modify support + +`monger.collection/find-and-modify` function implements [atomic Find and Modify](http://www.mongodb.org/display/DOCS/findAndModify+Command) command. +It is similar to the "regular" update operations but atomically modifies a document (at most one) and returns it. + +An example: + +``` clojure +(mgcol/find-and-modify "scoreboard" {:name "Sophie Bangs"} {$inc {:level 1}} :return-new true) +``` + +Contributed by [Baishampayan Ghose](https://github.com/ghoseb). + + ### monger.js is deprecated `monger.js` namespace is kept for backwards compatibility but is deprecated in favor of [ClojureWerkz Support](http://github.com/clojurewerkz/support) diff --git a/src/monger/collection.clj b/src/monger/collection.clj index 74c578f..107b9c0 100644 --- a/src/monger/collection.clj +++ b/src/monger/collection.clj @@ -1,5 +1,6 @@ ;; Copyright (c) 2011-2012 Michael S. Klishin ;; Copyright (c) 2012 Toby Hede +;; Copyright (c) 2012 Baishampayan Ghose ;; ;; The use and distribution terms for this software are covered by the ;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)