From ec8482433466d2800c9f92fd51dd28ad5cf8cd42 Mon Sep 17 00:00:00 2001 From: "Michael S. Klishin" Date: Mon, 12 Sep 2011 10:37:24 +0400 Subject: [PATCH] Correct documentation examples --- src/monger/collection.clj | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/monger/collection.clj b/src/monger/collection.clj index 5741b21..6ad7f52 100644 --- a/src/monger/collection.clj +++ b/src/monger/collection.clj @@ -168,17 +168,9 @@ If the object is not present in the database, insert operation will be performed: - (def ian_gillian - (monger.convertion/to-db-object - { :first_name \"Ian\" :last_name \"Gillan\" })) - (monger.collection/save \"people\" ian_gillian) + (monger.collection/save \"people\" { :first_name \"Ian\" :last_name \"Gillan\" }) - If the object is already in the database, update operation will be performed: - - (monger.collection/save \"people\" - { :_id (.get ^DBObject ian_gillian \"_id\") - :first_name \"Ian\" - :last_name \"Gillan\" :band \"Deep Purple\" })" + If the object is already in the database, it will be updated." ([^String collection, ^Map document] (let [^DBCollection coll (.getCollection monger.core/*mongodb-database* collection)] (.save coll (to-db-object document) monger.core/*mongodb-write-concern*)))