{:group-id "com.timezynk", :artifact-id "mongo", :version "0.9.13", :analysis {"clj" ({:name com.timezynk.mongo, :publics ({:name aggregate, :file "com/timezynk/mongo.clj", :line 827, :arglists ([ & ]), :doc "MongoDB aggregation.\n\n| Parameter | Description |\n| --- | --- |\n| `collection` | `keyword/string` Collection name. |\n| `pipeline` | The request pipeline queries. |\n\n**Returns**\n\nAggregation result.\n\n**Examples**\n\n```Clojure\n(aggregate :users\n {:$match {:age {:$gte 20}}}\n {:$project {:_id 0\n :name 1}})\n```", :type :var} {:name close-connection!, :file "com/timezynk/mongo.clj", :line 73, :arglists ([conn]), :type :var} {:name collation, :file "com/timezynk/mongo.clj", :line 177, :arglists ([ & :alternate [:non-ignorable :shifted] :backwards? :case-first [:lower :off :upper] :case-level? :max-variable [:punct :space] :normalization? :numeric-ordering? :strength [:identical :primary :quaternary :secondary :tertiary]]), :doc "Create collation.\n\n| Parameter | Description |\n| --- | --- |\n| `locale` | `string` The two-letter ICU locale string. |\n| `:alternate` | `optional enum` Should whitespace and punctuation be considered as base characters for purposes of comparison? |\n| | `:non-ignorable` Whitespace and punctuation are considered base characters. |\n| | `:shifted` Whitespace and punctuation are not considered base characters and are only distinguished at strength levels greater than 3. |\n| `:backwards?` | `optional boolean` Whether strings with diacritics sort from back of the string, such as with some French dictionary ordering. Default is `false`. |\n| `:case-first` | `optional enum` Sort order of case differences during tertiary level comparisons. |\n| | `:lower` Uppercase sorts before lowercase. |\n| | `:upper` Lowercase sorts before uppercase. |\n| | `:off` Default value. Similar to `:lower` with slight differences. |\n| `:case-level?` | `optional boolean` Flag that determines whether to include case comparison at strength level 1 or 2. |\n| `:max-variable` | `optional enum` Which characters are considered ignorable when `:alternate = :shifted`? Has no effect if `:alternate = :non-ignorable`. |\n| | `:punct` Both whitespace and punctuation are ignorable and not considered base characters. |\n| | `:space` Whitespace is ignorable and not considered to be base characters. |\n| `:normalization?` | `optional boolean` Check if text requires normalization and to perform normalization. Default is `false`. |\n| `:numeric-ordering?` | `optional boolean` Compare numeric strings as numbers or as strings. Default is `false`. |\n| `:strength` | `optional enum` The level of comparison to perform. |\n| | `:identical` Limited for specific use case of tie breaker. |\n| | `:primary` Collation performs comparisons of the base characters only, ignoring other differences such as diacritics and case. |\n| | `:secondary` Collation performs comparisons up to secondary differences, such as diacritics. That is, collation performs comparisons of base characters (primary differences) and diacritics (secondary differences). Differences between base characters takes precedence over secondary differences. |\n| | `:tertiary` Collation performs comparisons up to tertiary differences, such as case and letter variants. That is, collation performs comparisons of base characters (primary differences), diacritics (secondary differences), and case and variants (tertiary differences). Differences between base characters takes precedence over secondary differences, which takes precedence over tertiary differences. Default level. |\n| | `:quaternary` Limited for specific use case to consider punctuation when levels 1-3 ignore punctuation or for processing Japanese text. |\n\nFor more details, see the [manual page on collation](https://www.mongodb.com/docs/v5.3/reference/collation/).\n\n**Returns**\n\nThe collation object.\n\n**Examples**\n\n```Clojure\n(collation)\n```", :type :var} {:name collection-info, :file "com/timezynk/mongo.clj", :line 239, :arglists ([coll]), :doc "List full info of collection.\n\n| Parameter | Description |\n| --- | --- |\n| `name` | `keyword/string` Collection name. |", :type :var} {:name create-collection!, :file "com/timezynk/mongo.clj", :line 250, :arglists ([ & :collation :level :schema {} :validation {}]), :doc "Create collection.\n\n| Parameter | Description |\n| --- | --- |\n| `name` | `keyword/string` Collection name. |\n| `:collation` | `optional collation object` The collation of the collection. |\n| `:schema` | `optional map` The schema validation map. |\n| `:validation` | `optional map` Validation logic outside of the schema. |\n| `:level` | `optional enum` Validaton level: |\n| | `:strict` Apply validation rules to all inserts and all updates. Default value. |\n| | `:moderate` Applies validation rules to inserts and to updates on existing valid documents. |\n| | `:off` No validation for inserts or updates. |\n\n**Returns**\n\nThe collection object.\n\n**Examples**\n\n```Clojure\n; Collection with exactly one required field `name` of type `string`:\n(create-collection! :users :schema {:name (string)})\n\n; Collection where each document can have either a `name` field or an `address` field, but not both:\n(create-collection! :users :validation {:$or [{:name {:$ne nil} :address {:$exists 0}}\n {:name {:$exists 0} :address {:$ne nil}}]})\n```", :type :var} {:name create-connection!, :file "com/timezynk/mongo.clj", :line 40, :arglists ([ & :retry-writes? :write-concern [:acknowledged :unacknowledged :journaled :majority :w1 :w2 :w3]]), :doc "Create a connection object.\n\n| Parameter | Description |\n| --- | --- |\n| `uri` | `string` Database location. |\n| `:retry-writes?` | `optional boolean` Sets whether writes should be retried if they fail due to a network error. Default is `false`. |\n| `:write-concern` | `optional enum` Set write concern: |\n| | `:acknowledged` Write operations that use this write concern will wait for acknowledgement. Default. |\n| | `:majority` Exceptions are raised for network issues, and server errors; waits on a majority of servers for the write operation. |\n| | `:unacknowledged` Write operations that use this write concern will return as soon as the message is written to the socket. |\n| | `:w1` Write operations that use this write concern will wait for acknowledgement from a single member. |\n| | `:w2` Write operations that use this write concern will wait for acknowledgement from two members. |\n| | `:w3` Write operations that use this write concern will wait for acknowledgement from three members. |\n\n**Returns**\n\nThe connection object.\n\n**Examples**\n\n```Clojure\n; Create a connection with default options\n(connection \"mongodb://localhost:27017\")\n\n; Create a custom connection\n(connection \"mongodb://localhost:27017\" :retry-writes true :write-concern :w2)\n```", :type :var} {:name create-index!, :file "com/timezynk/mongo.clj", :line 325, :arglists ([ & :collation :background? :name :filter {} :sparse? :unique? ]), :doc "Create an index for a collection.\n\n| Parameter | Description |\n| --- | --- |\n| `collection` | `keyword/string` Collection name. |\n| `keys` | `map/list(keyword/string)` A document or a list of keywords or strings. |\n| `:collation` | `optional collation object` Collation of index. |\n| `:background?` | `optional boolean` Create the index in the background. Default `false`. |\n| `:name` | `optional string` A custom name for the index. |\n| `:filter` | `optional map` A partial-filter-expression for the index. |\n| `:sparse?` | `optional boolean` Don't index null values. Default `false`. |\n| `:unique?` | `optional boolean` Index values must be unique. Default `false`. |\n\n**Returns**\n\nThe index name.\n\n**Examples**\n\n```Clojure\n; Index over field-1 in descending order, field-2 as hashed\n(create-index! :coll {:field-1 -1 :field-2 \"hashed\"})\n\n; Shorthand for indexing over fields in ascending order\n(create-index! :coll [:field-1 :field-2])\n\n; Only flagged documents are indexed and searchable\n(create-index! :coll [:field-1] :filter {:flag-field true})\n```", :type :var} {:name delete!, :file "com/timezynk/mongo.clj", :line 735, :arglists ([ & :collation :hint {}]), :doc "Delete matching documents.\n\n| Parameter | Description |\n| --- | --- |\n| `collection` | `keyword/string` The collection. |\n| `query` | `map` A standard MongoDB query. |\n| `:collation` | `optional collation object` Collation used. |\n| `:hint` | `optional map` Indexing hint. |\n\n**Returns**\n\n```Clojure\n{:deleted-count }\n```", :type :var} {:name delete-one!, :file "com/timezynk/mongo.clj", :line 759, :arglists ([ & :collation :hint {}]), :doc "Delete first matching document.\n\n| Parameter | Description |\n| --- | --- |\n| `collection` | `keyword/string` The collection. |\n| `query` | `map` A standard MongoDB query. |\n| `:collation` | `optional collation object` Collation used. |\n| `:hint` | `optional map` Indexing hint. |\n\n**Returns**\n\n```Clojure\n{:deleted-count <0 or 1>}\n```", :type :var} {:name delete-one-by-id!, :file "com/timezynk/mongo.clj", :line 783, :arglists ([coll id & options]), :type :var} {:name drop-collection!, :file "com/timezynk/mongo.clj", :line 313, :arglists ([coll]), :type :var} {:name drop-index!, :file "com/timezynk/mongo.clj", :line 362, :arglists ([coll index]), :type :var} {:name fetch, :file "com/timezynk/mongo.clj", :line 371, :arglists ([] [ & :collation :limit :only {} :skip :sort {}]), :doc "Fetch documents from collection.\n\n| Parameter | Description |\n| --- | --- |\n| `collection` | `keyword/string` The collection. |\n| `query` | `map` A standard MongoDB query. |\n| `:collation` | `optional collation object` Collation used. |\n| `:limit` | `optional int` Number of documents to fetch. |\n| `:only` | `optional map/list` A map/list of fields to include or exclude. |\n| `:skip` | `optional int` Number of documents to skip before fetching. |\n| `:sort` | `optional map` A MongoDB map of sorting criteria. |\n\n**Returns**\n\nA lazy sequence of matching documents.\n\n**Examples**\n\n```Clojure\n; Fetch five documents from collection :users\n(fetch :users {} :limit 5)\n```", :type :var} {:name fetch-and-delete-one!, :file "com/timezynk/mongo.clj", :line 786, :arglists ([coll query & options]), :type :var} {:name fetch-and-delete-one-by-id!, :file "com/timezynk/mongo.clj", :line 793, :arglists ([coll id & options]), :type :var} {:name fetch-and-replace-one!, :file "com/timezynk/mongo.clj", :line 718, :arglists ([coll query doc & options]), :type :var} {:name fetch-and-replace-one-by-id!, :file "com/timezynk/mongo.clj", :line 728, :arglists ([coll id doc & options]), :type :var} {:name fetch-and-set-by-id!, :file "com/timezynk/mongo.clj", :line 674, :arglists ([coll id update & options]), :type :var} {:name fetch-and-set-one!, :file "com/timezynk/mongo.clj", :line 659, :arglists ([coll query update & options]), :doc "Shorthand for `fetch-and-update-one!` with a single `:$set` modifier.\n \n **Examples**\n\n```Clojure\n(fetch-and-set-one! :coll {} {:a 1})\n```\ntranslates to: \n```Clojure\n(fetch-and-update-one! :coll {} {:$set {:a 1}})\n```", :type :var} {:name fetch-and-update-by-id!, :file "com/timezynk/mongo.clj", :line 656, :arglists ([coll id update & options]), :type :var} {:name fetch-and-update-one!, :file "com/timezynk/mongo.clj", :line 629, :arglists ([ & :return-new? :upsert? :collation :only {} :hint {} :sort {}]), :doc "Update first matching document.\n\n| Parameter | Description |\n| --- | --- |\n| `collection` | `keyword/string` The collection. |\n| `query` | `map` A standard MongoDB query. |\n| `:return-new?` | `optional boolean` Return the updated document? Default if `false`. |\n| `:upsert?` | `optional boolean` If no document is found, create a new one. Default is `false`. |\n| `:collation` | `optional collation object` Collation used. |\n| `:only` | `optional map` A MongoDB map of fields to include or exclude. |\n| `:hint` | `optional map` Indexing hint. |\n| `:sort` | `optional map` A MongoDB map of sorting criteria. |\n\n**Returns**\n\nA single document or nil.", :type :var} {:name fetch-by-id, :file "com/timezynk/mongo.clj", :line 424, :arglists ([ & :only {}]), :doc "Fetch a single document by its id.\n\n| Parameter | Description |\n| --- | --- |\n| `collection` | `keyword/string` The collection. |\n| `id` | `ObjectId/string` The id. A string will be converted to an ObjectId. |\n| `:only` | `optional map` A MongoDB map of fields to include or exclude. |\n\n**Returns**\n\nA single document or `nil`.", :type :var} {:name fetch-count, :file "com/timezynk/mongo.clj", :line 439, :arglists ([] [ ]), :doc "Count the number of documents returned.\n\n| Parameter | Description |\n| --- | --- |\n| `collection` | `keyword/string` The collection. |\n| `query` | `map` A standard MongoDB query. |\n\n**Returns**\n\nNumber of matching documents.", :type :var} {:name fetch-one, :file "com/timezynk/mongo.clj", :line 403, :arglists ([] [ & :collation :only {} :skip :sort {}]), :doc "Return only the first document retrieved.\n\n| Parameter | Description |\n| --- | --- |\n| `collection` | `keyword/string` The collection. |\n| `query` | `map` A standard MongoDB query. |\n| `:collation` | `optional collation object` Collation used. |\n| `:only` | `optional map` A MongoDB map of fields to include or exclude. |\n| `:skip` | `optional int` Number of documents to skip before fetching. |\n| `:sort` | `optional map` A MongoDB map of sorting criteria. |\n\n**Returns**\n\nA single document or `nil`.", :type :var} {:name insert!, :file "com/timezynk/mongo.clj", :line 459, :arglists ([ & :write-concern [:acknowledged :unacknowledged :journaled :majority :w1 :w2 :w3]] [ & :write-concern [:acknowledged :unacknowledged :journaled :majority :w1 :w2 :w3]]), :doc "Insert one document or a list thereof in a collection. Inserting a list is atomic.\n\n| Parameter | Description |\n| --- | --- |\n| `collection` | `keyword/string` The collection. |\n| `document` | `map` A document. |\n| `document-list` | `list(map)` A list of documents. |\n| `:write-concern` | `optional enum` Set write concern: |\n| | `:acknowledged` Write operations that use this write concern will wait for acknowledgement. Default. |\n| | `:majority` Exceptions are raised for network issues, and server errors; waits on a majority of servers for the write operation. |\n| | `:unacknowledged` Write operations that use this write concern will return as soon as the message is written to the socket. |\n| | `:w1` Write operations that use this write concern will wait for acknowledgement from a single member. |\n| | `:w2` Write operations that use this write concern will wait for acknowledgement from two members. |\n| | `:w3` Write operations that use this write concern will wait for acknowledgement from three members. |\n\n**Returns**\n\nThe document/s with `_id` fields, either a single document or a lazy sequence.\n\n**Examples**\n\n```Clojure\n(insert! :users {:name \"Alice\"})\n\n(insert! :users [{:name \"Alice\"} {:name \"Bob\"}])\n```", :type :var} {:name insert-one!, :file "com/timezynk/mongo.clj", :line 496, :arglists ([coll doc & options]), :doc "This is identical to `insert!`, except if payload is nil, return nil instead of throwing exception. Use this function when\nthe payload is expected to be a nil-able document.", :type :var} {:name list-collection-names, :file "com/timezynk/mongo.clj", :line 231, :arglists ([]), :doc "List keyworded names of all collections in database.\n", :type :var} {:name list-collections, :file "com/timezynk/mongo.clj", :line 225, :arglists ([]), :doc "List full info of all collections in database.\n", :type :var} {:name list-databases, :file "com/timezynk/mongo.clj", :line 142, :arglists ([]), :doc "List databases for this connection.\n\n**Returns**\n\nA lazy sequence of database objects.", :type :var} {:name list-indexes, :file "com/timezynk/mongo.clj", :line 321, :arglists ([coll]), :type :var} {:name modify-collection!, :file "com/timezynk/mongo.clj", :line 283, :arglists ([ & :collation :level :schema {} :validation {}]), :doc "Make updates to a collection.\n\n| Parameter | Description |\n| --- | --- |\n| `name` | `keyword/string` Collection name. |\n| `:name` | `optional keyword/string` New name. |\n| `:collation` | `optional collation object` The collation of the collection. |\n| `:schema` | `optional map` The schema validation map. |\n| `:validation` | `optional map` Validation logic outside of the schema. |\n| `:level` | `optional enum` Validaton level: |\n| | `:strict` Apply validation rules to all inserts and all updates. Default value. |\n| | `:moderate` Applies validation rules to inserts and to updates on existing valid documents. |\n| | `:off` No validation for inserts or updates. |\n| `:validate?` | `optional boolean` Ensure that existing documents in the collection conform to the new schema or validation. Default `false`. |\n\n**Returns**\n\nThe collection object.\n\n**Examples**\n\n```Clojure\n(modify-collection! :coll :name :coll-2)\n```", :type :var} {:name replace-one!, :file "com/timezynk/mongo.clj", :line 681, :arglists ([ & :upsert? :collation :hint {}]), :doc "Replace a single document.\n\n| Parameter | Description |\n| --- | --- |\n| `collection` | `keyword/string` The collection. |\n| `query` | `map` A standard MongoDB query. |\n| `document` | `map` The new document. |\n| `:upsert?` | `optional boolean` If no document is found, create a new one. Default is `false`. |\n| `:collation` | `optional collation object` Collation used. |\n| `:hint` | `optional map` Indexing hint. |\n\n**Returns**\n\n```Clojure\n{:matched-count <0 or 1>\n :modified-count <0 or 1>}\n```", :type :var} {:name replace-one-by-id!, :file "com/timezynk/mongo.clj", :line 714, :arglists ([coll id doc & options]), :type :var} {:name set!, :file "com/timezynk/mongo.clj", :line 550, :arglists ([coll query update & options]), :doc "Shorthand for `update!` with a single `:$set` modifier.\n \n **Examples**\n\n```Clojure\n(set! :coll {} {:a 1})\n```\ntranslates to: \n```Clojure\n(update! :coll {} {:$set {:a 1}})\n```", :type :var} {:name set-by-id!, :file "com/timezynk/mongo.clj", :line 626, :arglists ([coll id update & options]), :type :var} {:name set-one!, :file "com/timezynk/mongo.clj", :line 611, :arglists ([coll query update & options]), :doc "Shorthand for `update-one!` with a single `:$set` modifier.\n \n **Examples**\n\n```Clojure\n(set-one! :coll {} {:a 1})\n```\ntranslates to: \n```Clojure\n(update-one! :coll {} {:$set {:a 1}})\n```", :type :var} {:name transaction, :file "com/timezynk/mongo.clj", :line 800, :arglists ([& body]), :doc "Functionally perform a transaction. Encapsulated database requests are queued and then\natomically executed when the function goes out of scope.\n\n**Returns**\n\nThe result of the last encapsulated expression.\n\n**Examples**\n\n```Clojure\n(transaction\n (insert! :users {:name \"My Name\"})\n (fetch! :users))\n```", :type :macro} {:name update!, :file "com/timezynk/mongo.clj", :line 507, :arglists ([ & :upsert? :collation :hint {} :write-concern [:acknowledged :unacknowledged :journaled :majority :w1 :w2 :w3]]), :doc "Update matching documents.\n\n| Parameter | Description |\n| --- | --- |\n| `collection` | `keyword/string` The collection. |\n| `query` | `map` A standard MongoDB query. |\n| `update` | `map` A valid update document. |\n| `:upsert?` | `optional boolean` If no document is found, create a new one. Default is `false`. |\n| `:collation` | `optional collation object` Collation used. |\n| `:hint` | `optional map/list` Indexing hint. |\n| `:write-concern` | `optional enum` Set write concern: |\n| | `:acknowledged` Write operations that use this write concern will wait for acknowledgement. Default. |\n| | `:majority` Exceptions are raised for network issues, and server errors; waits on a majority of servers for the write operation. |\n| | `:unacknowledged` Write operations that use this write concern will return as soon as the message is written to the socket. |\n| | `:w1` Write operations that use this write concern will wait for acknowledgement from a single member. |\n| | `:w2` Write operations that use this write concern will wait for acknowledgement from two members. |\n| | `:w3` Write operations that use this write concern will wait for acknowledgement from three members. |\n\n**Returns**\n\n```Clojure\n{:matched-count \n :modified-count }\n```\n\n**Examples**\n\n```Clojure\n(update!)\n```", :type :var} {:name update-by-id!, :file "com/timezynk/mongo.clj", :line 608, :arglists ([coll id update & options]), :type :var} {:name update-one!, :file "com/timezynk/mongo.clj", :line 565, :arglists ([ & :upsert? :collation :hint {} :write-concern [:acknowledged :unacknowledged :journaled :majority :w1 :w2 :w3]]), :doc "Update first matching document.\n\n| Parameter | Description |\n| --- | --- |\n| `collection` | `keyword/string` The collection. |\n| `query` | `map` A standard MongoDB query. |\n| `update` | `map/list` A valid update document or pipeline. |\n| `:upsert?` | `optional boolean` If no document is found, create a new one. Default is `false`. |\n| `:collation` | `optional collation object` Collation used. |\n| `:hint` | `optional map/list` Indexing hint. |\n| `:write-concern` | `optional enum` Set write concern: |\n| | `:acknowledged` Write operations that use this write concern will wait for acknowledgement. Default. |\n| | `:majority` Exceptions are raised for network issues, and server errors; waits on a majority of servers for the write operation. |\n| | `:unacknowledged` Write operations that use this write concern will return as soon as the message is written to the socket. |\n| | `:w1` Write operations that use this write concern will wait for acknowledgement from a single member. |\n| | `:w2` Write operations that use this write concern will wait for acknowledgement from two members. |\n| | `:w3` Write operations that use this write concern will wait for acknowledgement from three members. |\n\n**Returns**\n\n```Clojure\n{:matched-count <0 or 1>\n :modified-count <0 or 1>}\n```\n\n**Examples**\n\n```Clojure\n(update-one!)\n```", :type :var} {:name with-codecs, :file "com/timezynk/mongo.clj", :line 152, :arglists ([ & ]), :doc "Functionally add or change codecs. Reverts to earlier settings when leaving scope.\n\n| Parameter | Description |\n| --- | --- |\n| `codecs` | `list` A list of codec objects. |\n| `bson-types` | `map` A map of Bson types and their corresponding Java classes. |\n| `body` | Encapsulated program calling the database. |\n\n", :type :macro} {:name with-database, :file "com/timezynk/mongo.clj", :line 117, :arglists ([ & ]), :doc "Functionally set up or change database. Reverts to earlier settings when leaving scope.\n\n| Parameter | Description |\n| --- | --- |\n| `database` | `string` Name of database to use. |\n| `body` | Encapsulated program calling the database. |\n\n**Returns**\n\nThe result of the last encapsulated expression.\n\n**Examples**\n\n```Clojure\n(with-database \"my-database-2\"\n (insert! :users {:name \"My Name\"})\n (fetch! :users))\n```", :type :macro} {:name with-mongo, :file "com/timezynk/mongo.clj", :line 77, :arglists ([ & ] [ & ]), :doc "Functionally set up or change mongodb connection. Reverts to earlier settings when leaving scope.\n\n| Parameter | Description |\n| --- | --- |\n| `uri` | `string` Connection string. See the [API documentation](http://mongodb.github.io/mongo-java-driver/4.5/apidocs/mongodb-driver-core/com/mongodb/ConnectionString.html) for more details. |\n| `connection` | `Connection` A connection object. |\n| `body` | Encapsulated program utilizing the connection. |\n\n**Returns**\n\nThe result of the last encapsulated expression.\n\n**Examples**\n\n```Clojure\n(with-mongo \"mongodb://localhost:27017/my-database\"\n (insert! :users {:name \"My Name\"})\n (fetch! :users))\n```", :type :macro}), :doc "A functional Clojure wrapper for the modern Java MongoDB API.\n"} {:name com.timezynk.mongo.config, :publics ()} {:name com.timezynk.mongo.guards, :publics ({:name bad-modifier, :file "com/timezynk/mongo/guards.clj", :line 57, :arglists ([doc]), :doc "A default guard for `update!`, `update-one!`, `fetch-and-update-one!`. \nThe library exception for bad modifiers is a bit uninformative,\nand has been replaced with a better one.", :type :var} {:name bounce-empty, :file "com/timezynk/mongo/guards.clj", :line 32, :arglists ([doc]), :doc "A default guard for `insert!`, `insert-one!`.\nAn empty payload is allowed but does nothing.", :type :var} {:name empty-update, :file "com/timezynk/mongo/guards.clj", :line 46, :arglists ([doc]), :doc "A default guard for `update!`, `update-one!`, `fetch-and-update-one!`, `replace-one!`,\n`fetch-and-replace-one!`. An empty payload should always throw an exception.", :type :var} {:name modifiers, :file "com/timezynk/mongo/guards.clj", :line 53, :type :var} {:name nil-update, :file "com/timezynk/mongo/guards.clj", :line 39, :arglists ([doc]), :doc "A default guard for `update!`, `update-one!`, `fetch-and-update-one!`.\nEnsure consistent exception for nil.", :type :var} {:name return, :file "com/timezynk/mongo/guards.clj", :line 12, :arglists ([result]), :doc "Return early without making any API call.\n\n**Examples**\n\nIgnore any insert calls with a message:\n\n```Clojure\n(with-guards {:insert (fn [_] (return \"a message\"))}\n (insert! :coll {:a 1})) ; No call made, just returns \"a message\"\n```", :type :macro} {:name with-guards, :file "com/timezynk/mongo/guards.clj", :line 86, :arglists ([{:insert , :update , :replace } & ]), :doc "Guards for API functions. They allow you to check for payload conditions before\na call is made. If the function returns truthy, the call goes through. If it\nreturns falsy, no call is made, instead the payload is returned. For serious\nerrors, throw an exception.\n\n guards `insert!`. By default, it returns false for empty lists, true otherwise.\n\n guards `update!`, `update-one!`, `fetch-and-update-one!`. By default, it will\nthrow exceptions for a list payload and a root field that isn't a modifier. List\nhandling is a bit wonky. Since it's not needed, it's better to not accept it. The preset\nexception for missing modifiers is unclear, and has been replaced.\n\n| Parameter | Description |\n| --- | --- |\n| `:insert` | `optional fn` Called for `insert!`. |\n| `:update` | `optional fn` Called for `update!`, `update-one!`, `fetch-and-update-one!`. |\n| `:replace` | `optional fn` Called for `replace-one!`, `fetch-and-replace-one!`. |\n| `body` | Encapsulated program calling the database. |\n\n**Examples**\n\n```Clojure\n; Remove guards for payload:\n(with-guards {:insert identity}\n (insert! :coll [])) ; Throws exception\n```", :type :macro}), :doc "Guards make checks of payloads before the API call proper.\n"} {:name com.timezynk.mongo.hooks, :publics ({:name ignore-hooks, :file "com/timezynk/mongo/hooks.clj", :line 34, :arglists ([& ]), :doc "If any hooks are set, ignore them.\n\n| Parameter | Description |\n| --- | --- |\n| `body` | Encapsulated program for which database hooks are to be ignored. |", :type :macro} {:name with-hooks, :file "com/timezynk/mongo/hooks.clj", :line 6, :arglists ([{:read , :write } & ]), :doc "Insert hooks for converting documents. The function will be called for each document\nreturned from MongoDB; the will be called for each document sent to MongoDB, both\nfor the query and for the payload.\n\nThe hook is applied recursively to nested documents.\n\n| Parameter | Description |\n| --- | --- |\n| `:read` | `optional fn` Called when returning a document from MongoDB. |\n| `:write` | `optional fn` Called for a query or payload to MongoDB. |\n| `body` | Encapsulated program calling the database. |\n\n**Examples**\n\n```Clojure\n; When a document is written to the database, replace the field 'name' with 'username':\n(with-hooks {:write #(clojure.set/rename-keys % {:name :username})}\n (insert! :coll {:name \"My Name\"}))\n```", :type :macro})} {:name com.timezynk.mongo.schema, :publics ({:name any, :file "com/timezynk/mongo/schema.clj", :line 298, :arglists ([& options]), :doc "Field can be of any type.\n\n| Parameter | Description |\n| --- | --- |\n| `:optional?` | `optional boolean` Is the field optional? |\n\n**Examples**\n\n```Clojure\n(create-collection! :coll :schema {:field-1 (any)})\n```", :type :var} {:name array, :file "com/timezynk/mongo/schema.clj", :line 269, :arglists ([ & :optional? :min-length :max-length :unique? ]), :doc "Field must be an `array`.\n\n| Parameter | Description |\n| --- | --- |\n| `schema` | `fn` A call to a schema function. |\n| `:optional?` | `optional boolean` Is the field optional? |\n| `:min-length` | `optional integer` Minimum length of the array. |\n| `:max-length` | `optional integer` Maximum length of the array. |\n| `:unique?` | `optional boolean` Whether array values must be unique. |\n\n**Examples**\n\n```Clojure\n; field-1 must be an array of strings and contain at least one element:\n(create-collection! :coll :schema {:field-1 (array (string) :min-length 1)})\n```", :type :var} {:name boolean, :file "com/timezynk/mongo/schema.clj", :line 214, :arglists ([& :optional? ]), :doc "Field must be a `boolean`.\n\n| Parameter | Description |\n| --- | --- |\n| `:optional?` | `optional boolean` Is the field optional? |\n\n**Examples**\n\n```Clojure\n; field-1 must be a boolean and must be included:\n(create-collection! :coll :schema {:field-1 (boolean)})\n```", :type :var} {:name date-time, :file "com/timezynk/mongo/schema.clj", :line 232, :arglists ([& :optional? ]), :doc "Field must be a `java.util.Date` object.\n\n| Parameter | Description |\n| --- | --- |\n| `:optional?` | `optional boolean` Is the field optional? |\n\n**Examples**\n\n```Clojure\n; Set field-1 to current date and time:\n(create-collection! :coll :schema {:field-1 (date-time)})\n```", :type :var} {:name id, :file "com/timezynk/mongo/schema.clj", :line 102, :arglists ([& :optional? ]), :doc "Field must be an `ObjectId`.\n\n| Parameter | Description |\n| --- | --- |\n| `:optional?` | `optional boolean` Is the field optional? |\n\n**Examples**\n\n```Clojure\n; field-1 must be an ObjectId and can be excluded:\n(create-collection! :coll :schema {:field-1 (id :optional? true)})\n```", :type :var} {:name integer, :file "com/timezynk/mongo/schema.clj", :line 171, :arglists ([& :optional? :in [] :min :max ]), :doc "Field must be an 8-byte `long integer`.\n\n| Parameter | Description |\n| --- | --- |\n| `:optional?` | `optional boolean` Is the field optional? |\n| `:in` | `optional seq` A collection of acceptable values. |\n| `:min` | `optional integer` Minimum value. |\n| `:max` | `optional integer` Maximum value. |\n\n**Examples**\n\n```Clojure\n; field-1 must be an integer and must be included:\n(create-collection! :coll :schema {:field-1 (integer)})\n```", :type :var} {:name map, :file "com/timezynk/mongo/schema.clj", :line 250, :arglists ([& :optional? ]), :doc "Field must be a `map`.\n\n| Parameter | Description |\n| --- | --- |\n| `:optional?` | `optional boolean` Is the field optional? |\n\n**Examples**\n\n```Clojure\n; Set field-1 to map containing two strings:\n(create-collection! :coll :schema {:field-1 (map {:str-1 (string)\n :str-2 (string)})})\n```", :type :var} {:name number, :file "com/timezynk/mongo/schema.clj", :line 147, :arglists ([& :optional? :in [] :min :max ]), :doc "Field must be an 8-byte `double`.\n\n| Parameter | Description |\n| --- | --- |\n| `:optional?` | `optional boolean` Is the field optional? |\n| `:in` | `optional seq` A collection of acceptable values. |\n| `:min` | `optional integer` Minimum value. |\n| `:max` | `optional integer` Maximum value. |\n\n**Examples**\n\n```Clojure\n; field-1 must be a number and must be included:\n(create-collection! :coll :schema {:field-1 (number)})\n```", :type :var} {:name string, :file "com/timezynk/mongo/schema.clj", :line 120, :arglists ([& :optional? :in [] :regex :min-length :max-length ]), :doc "Field must be a `string`.\n\n| Parameter | Description |\n| --- | --- |\n| `:optional?` | `optional boolean` Is the field optional? |\n| `:in` | `optional seq` A collection of acceptable values. |\n| `:regex` | `optional string` A regular expression that values must pass. |\n| `:min-length` | `optional integer` Minimum length of the string. |\n| `:max-length` | `optional integer` Maximum length of the string. |\n\n**Examples**\n\n```Clojure\n; field-1 must be a string and must be included:\n(create-collection! :coll :schema {:field-1 (string)})\n```", :type :var} {:name timestamp, :file "com/timezynk/mongo/schema.clj", :line 195, :arglists ([& :optional? ]), :doc "Field must be a `timestamp`.\n\n| Parameter | Description |\n| --- | --- |\n| `:optional?` | `optional boolean` Is the field optional? |\n\n**Examples**\n\n```Clojure\n; field-1 must be an integer and must be included:\n(create-collection! :coll :schema {:field-1 (timestamp)})\n```", :type :var}), :doc "Functions for defining a collection schema.\n"} {:name com.timezynk.mongo.util, :publics ({:name make-collection!, :file "com/timezynk/mongo/util.clj", :line 77, :arglists ([coll & options]), :type :var} {:name set-mongo-uri!, :file "com/timezynk/mongo/util.clj", :line 17, :arglists ([]), :doc "Set connection string prior to creating a persistent binding.\n\n| Parameter | Description |\n| --- | --- |\n| `uri` | `string` Database location. |", :type :var} {:name wrap-mongo, :file "com/timezynk/mongo/util.clj", :line 41, :arglists ([& ]), :doc "Functionally set up or change mongodb connection, using a persistent connection. Reverts to earlier settings when leaving scope.\n\n1. Looks for a connection string set by a prior call to `set-mongo-uri!`.\n2. Failing that, retrieves a connection string `MONGO_URI` environment variable.\n\nThe connection string is used only once to set up the persistent connection.\n\n| Parameter | Description |\n| --- | --- |\n| `body` | Encapsulated program calling the database. |\n\n**Returns**\n\nThe result of the last encapsulated expression.\n\n**Examples**\n\n```Clojure\n(set-mongo-uri! \"mongodb://localhost:27017/my-database\")\n(wrap-mongo\n (insert! :users {:name \"My Name\"})\n (fetch! :users))\n```", :type :macro})} {:name com.timezynk.mongo.watch, :publics ({:name on-delete, :file "com/timezynk/mongo/watch.clj", :line 51, :arglists ([ ]), :doc "Listen for an `update!` event.\n\n| Parameter | Description |\n| --- | --- |\n| `collection` | `keyword/string` The collection. |\n| `callback function` | `function` A callback function that accepts three parameters: |\n| | `java.util.Date` Time of event. |\n| | `map` Contains a single `_id` field with the id of the deleted document. |\n\n**Examples**\n\n```Clojure\n(defn delete-event [time id]\n ; Do something\n)\n\n(on-delete :coll delete-event)\n```", :type :var} {:name on-insert, :file "com/timezynk/mongo/watch.clj", :line 5, :arglists ([ ]), :doc "Listen for an `insert!` event.\n\n| Parameter | Description |\n| --- | --- |\n| `collection` | `keyword/string` The collection. |\n| `callback function` | `function` A callback function that accepts two parameters: |\n| | `java.util.Date` Time of event. |\n| | `map` The inserted document. |\n\n**Examples**\n\n```Clojure\n(defn insert-event [time doc]\n ; Do something\n)\n\n(on-insert :coll insert-event)\n```", :type :var} {:name on-update, :file "com/timezynk/mongo/watch.clj", :line 28, :arglists ([ ]), :doc "Listen for an `update!` event.\n\n| Parameter | Description |\n| --- | --- |\n| `collection` | `keyword/string` The collection. |\n| `callback function` | `function` A callback function that accepts three parameters: |\n| | `java.util.Date` Time of event. |\n| | `map` Contains the id of the updated document, plus the fields that were updated. |\n\n**Examples**\n\n```Clojure\n(defn update-event [time updated-fields]\n ; Do something\n)\n\n(on-update :coll update-event)\n```", :type :var})})}, :pom-str "\n\n 4.0.0\n com.timezynk\n mongo\n jar\n 0.9.13\n mongo\n Clojure wrapper for com.mongodb.client Java API.\n https://github.com/TimeZynk/mongo\n \n \n MIT\n https://mit-license.org\n \n \n \n https://github.com/TimeZynk/mongo\n scm:git:git://github.com/TimeZynk/mongo.git\n scm:git:ssh://git@github.com/TimeZynk/mongo.git\n 11eaf1e2a88d45deb398440326596da46fd3fabb\n \n \n src\n src\n \n \n resources\n \n \n \n \n resources\n \n \n target\n target/classes\n \n \n org.codehaus.mojo\n build-helper-maven-plugin\n 1.7\n \n \n add-test-source\n generate-test-sources\n \n add-test-source\n \n \n \n test\n \n \n \n \n \n \n \n \n \n central\n https://repo1.maven.org/maven2/\n \n false\n \n \n true\n \n \n \n clojars\n https://repo.clojars.org/\n \n true\n \n \n true\n \n \n \n \n \n \n \n \n ch.qos.logback\n logback-core\n 1.2.9\n \n \n ch.qos.logback\n logback-classic\n 1.2.9\n \n \n ch.qos.logback.contrib\n logback-jackson\n 0.1.5\n \n \n ch.qos.logback.contrib\n logback-json-classic\n 0.1.5\n \n \n org.apache.logging.log4j\n log4j-to-slf4j\n 2.17.0\n \n \n org.clojure\n clojure\n 1.10.3\n \n \n org.clojure\n core.async\n 1.3.618\n \n \n org.clojure\n tools.logging\n 1.2.4\n \n \n org.mongodb\n mongodb-driver-sync\n 5.0.1\n \n \n\n\n\n"}