Starting adding samples.
This commit is contained in:
parent
4124b033f6
commit
b91214cf37
3 changed files with 26 additions and 1 deletions
|
|
@ -6,6 +6,13 @@ Monger is an experimental idiomatic Clojure wrapper around MongoDB Java driver
|
||||||
|
|
||||||
TBD
|
TBD
|
||||||
|
|
||||||
|
## Samples
|
||||||
|
|
||||||
|
To run sample, install lein-exec (https://github.com/kumarshantanu/lein-exec) and execute:
|
||||||
|
|
||||||
|
lein exec examples/basic_operations.clj
|
||||||
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Copyright (C) 2011 Orceo GmbH
|
Copyright (C) 2011 Orceo GmbH
|
||||||
|
|
|
||||||
16
examples/basic_operations.clj
Normal file
16
examples/basic_operations.clj
Normal file
|
|
@ -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"])) ]
|
||||||
|
))
|
||||||
|
|
||||||
|
|
@ -2,5 +2,7 @@
|
||||||
:description "Monger is an experimental idiomatic Clojure wrapper around MongoDB Java driver"
|
:description "Monger is an experimental idiomatic Clojure wrapper around MongoDB Java driver"
|
||||||
:license { :name "Eclipse Public License" }
|
:license { :name "Eclipse Public License" }
|
||||||
:dependencies [[org.clojure/clojure "1.3.0-beta3"]
|
: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)
|
:warn-on-reflection true)
|
||||||
Loading…
Reference in a new issue