diff --git a/CHANGELOG.md b/CHANGELOG.md index d4516c2..00e033c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Change Log All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/). -## 0.6.0-SNAPSHOT +## 0.6.0 - 2020-01-10 ### Added - Support for bulk-write diff --git a/README.md b/README.md index 3e5171b..a462483 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ For Leinengen, add this to your project.clj: [org.mongodb/mongodb-driver-sync "3.11.2"] ;; This wrapper library -[mongo-driver-3 "0.5.0"] +[mongo-driver-3 "0.6.0"] ``` ## Getting started @@ -142,18 +142,18 @@ except each operation is defined as a 2-tuple rather than a map. ```clojure ;; Execute a mix of operations in one go -(bulk-write [[:insert-one {:document {:a 1}}] - [:delete-one {:filter {:a 1}}] - [:delete-many {:filter {:a 1}}] - [:update-one {:filter {:a 1} :update {:$set {:a 2}}}] - [:update-many {:filter {:a 1} :update {:$set {:a 2}}}] - [:replace-one {:filter {:a 1} :replacement {:a 2}}]]) +(,c/bulk-write [[:insert-one {:document {:a 1}}] + [:delete-one {:filter {:a 1}}] + [:delete-many {:filter {:a 1}}] + [:update-one {:filter {:a 1} :update {:$set {:a 2}}}] + [:update-many {:filter {:a 1} :update {:$set {:a 2}}}] + [:replace-one {:filter {:a 1} :replacement {:a 2}}]]) ; => a BulkWriteResult ;; Each operation can take the same options as their respective functions -(bulk-write [[:update-one {:filter {:a 1} :update {:$set {:a 2}} :upsert? true}] - [:update-many {:filter {:a 1} :update {:$set {:a 2}} :upsert? true}] - [:replace-one {:filter {:a 1} :replacement {:a 2} :upsert? true}]]) +(mc/bulk-write [[:update-one {:filter {:a 1} :update {:$set {:a 2}} :upsert? true}] + [:update-many {:filter {:a 1} :update {:$set {:a 2}} :upsert? true}] + [:replace-one {:filter {:a 1} :replacement {:a 2} :upsert? true}]]) ``` ### Using transactions