Liking cljdoc? Tell your friends :D

monger.core

Thin idiomatic wrapper around MongoDB Java client. monger.core includes fundamental functions that perform database/replica set connection, set default write concern, default database, performing commands and so on. Most of the functionality is in other monger.* namespaces, in particular monger.collection, monger.query and monger.gridfs

Related documentation guides:

Thin idiomatic wrapper around MongoDB Java client. monger.core includes
fundamental functions that perform database/replica set connection, set default write concern, default database, performing commands
and so on. Most of the functionality is in other monger.* namespaces, in particular monger.collection, monger.query and monger.gridfs

Related documentation guides:

* http://clojuremongodb.info/articles/connecting.html
* http://clojuremongodb.info/articles/commands.html
* http://clojuremongodb.info/articles/gridfs.html
raw docstring

*mongodb-host*clj

source

*mongodb-port*clj

source

*mongodb-write-concern*clj

source

admin-dbclj

(admin-db conn)

Returns admin database

Returns admin database
sourceraw docstring

admin-db-nameclj

source

commandclj

(command database cmd)

Runs a database command (please check MongoDB documentation for the complete list of commands).

Ordering of keys in the command document may matter. Please use sorted maps instead of map literals, for example: (array-map :near 50 :test 430 :num 10)

For commonly used commands (distinct, count, map/reduce, etc), use monger.command and monger.collection functions such as /distinct, /count, /drop, /dropIndexes, and /mapReduce respectively.

Runs a database command (please check MongoDB documentation for the complete list of commands).

Ordering of keys in the command document may matter. Please use sorted maps instead of map literals, for example:
(array-map :near 50 :test 430 :num 10)

For commonly used commands (distinct, count, map/reduce, etc), use monger.command and monger.collection functions such as
/distinct, /count,  /drop, /dropIndexes, and /mapReduce respectively.
sourceraw docstring

connectclj

(connect)
(connect {:keys [host port uri] :or {host *mongodb-host* port *mongodb-port*}})
(connect server-address options)
(connect [server-address & more] options)
(connect server-address options credentials)

Connects to MongoDB. When used without arguments, connects to

Arguments: :host ("127.0.0.1" by default) :port (27017 by default)

Connects to MongoDB. When used without arguments, connects to

Arguments:
  :host ("127.0.0.1" by default)
  :port (27017 by default)
sourceraw docstring

connect-via-uriclj

(connect-via-uri uri-string)

Connects to MongoDB using a URI, returns the connection and database as a map with :conn and :db. Commonly used for PaaS-based applications, for example, running on Heroku. If username and password are provided, performs authentication.

Connects to MongoDB using a URI, returns the connection and database as a map with :conn and :db.
Commonly used for PaaS-based applications, for example, running on Heroku.
If username and password are provided, performs authentication.
sourceraw docstring

connect-with-credentialsclj

(connect-with-credentials credentials)
(connect-with-credentials hostname credentials)
(connect-with-credentials hostname port credentials)

Connect with provided credentials and default options

Connect with provided credentials and default options
sourceraw docstring

Countablecljprotocol

countclj

(count this)

Returns size of the object

Returns size of the object
source

disconnectclj

(disconnect conn)

Closes default connection to MongoDB

Closes default connection to MongoDB
sourceraw docstring

drop-dbclj

(drop-db conn db)

Drops a database

Drops a database
sourceraw docstring

get-dbclj

(get-db conn name)

Get database reference by name.

Get database reference by name.
sourceraw docstring

get-db-namesclj

(get-db-names conn)

Gets a list of all database names present on the server

Gets a list of all database names present on the server
sourceraw docstring

get-gridfsclj

(get-gridfs conn name)

Get GridFS for the given database.

Get GridFS for the given database.
sourceraw docstring

mongo-optionsclj

(mongo-options opts)
source

mongo-options-builderclj

(mongo-options-builder
  {:keys [add-cluster-listener add-cluster-listeners add-command-listener
          add-command-listeners add-connection-pool-listener
          add-connection-pool-listeners add-server-listener add-server-listeners
          add-server-monitor-listener add-server-monitor-listeners
          always-use-mbeans application-name codec-registry compressor-list
          connect-timeout connections-per-host cursor-finalizer-enabled
          db-decoder-factory db-encoder-factory description
          heartbeat-connect-timeout heartbeat-frequency heartbeat-socket-timeout
          local-threshold max-connection-idle-time max-connection-life-time
          max-wait-time min-connections-per-host min-heartbeat-frequency
          read-concern read-preference required-replica-set-name retry-writes
          server-selection-timeout server-selector socket-keep-alive
          socket-factory socket-timeout ssl-context ssl-enabled
          ssl-invalid-host-name-allowed
          threads-allowed-to-block-for-connection-multiplier uuid-representation
          write-concern]})
source

raw-commandclj

(raw-command database cmd)

Like monger.core/command but accepts DBObjects

Like monger.core/command but accepts DBObjects
sourceraw docstring

server-addressclj

(server-address hostname)
(server-address hostname port)
source

set-default-write-concern!clj

(set-default-write-concern! wc)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close