diff --git a/README.md b/README.md index 8eedc1c..9044056 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,13 @@ Monger is an experimental idiomatic Clojure wrapper around MongoDB Java driver TBD +## Samples + +To run sample, install lein-exec (https://github.com/kumarshantanu/lein-exec) and execute: + + lein exec examples/basic_operations.clj + + ## License Copyright (C) 2011 Orceo GmbH diff --git a/examples/basic_operations.clj b/examples/basic_operations.clj new file mode 100644 index 0000000..209f7cf --- /dev/null +++ b/examples/basic_operations.clj @@ -0,0 +1,16 @@ +(ns examples.basic_operations + (:gen-class) + (:require [monger.core]) + (:import (com.mongodb Mongo DB)) + (:use [clojure.tools.cli])) + + +(do + (let + [ args *command-line-args* + parsed-args (cli args + (optional ["--port" "Mongodb port" :default 27017]) + (optional ["--host" "Mongodb host" :default "localhost"]) + (optional ["--db-name" :default "monger-example"])) ] + )) + diff --git a/project.clj b/project.clj index 5c8843b..807305c 100644 --- a/project.clj +++ b/project.clj @@ -2,5 +2,7 @@ :description "Monger is an experimental idiomatic Clojure wrapper around MongoDB Java driver" :license { :name "Eclipse Public License" } :dependencies [[org.clojure/clojure "1.3.0-beta3"] - [org.mongodb/mongo-java-driver "2.6.5"]] + [org.mongodb/mongo-java-driver "2.6.5"] + [org.clojure/tools.cli "0.1.0"] + ] :warn-on-reflection true) \ No newline at end of file