Liking cljdoc? Tell your friends :D

com.timezynk.useful.mongo


acceptance-ofclj

(acceptance-of attribute
               &
               {:keys [allow-nil accept]
                :or {allow-nil false accept #{true "true" "1"}}})

Returns a function that, when given a map, will validate that the value of the attribute in that map is accepted. By default, values that are considered accepted: true, "true", "1". Primarily used for validation of data that comes from Web forms.

Accepted options:

:allow-nil (default: false): should nil values be allowed? :accept (default: #{true, "true", "1"}): pass to use a custom list of values that will be considered accepted

Used in conjunction with validation-set:

(use 'validateur.validations)

(validation-set (presence-of :name) (presence-of :age) (acceptance-of :terms))

Returns a function that, when given a map, will validate that the value of the attribute in that map is accepted.
By default, values that are considered accepted: true, "true", "1". Primarily used for validation of data that comes from
Web forms.

Accepted options:

:allow-nil (default: false): should nil values be allowed?
:accept (default: #{true, "true", "1"}): pass to use a custom list of values that will be considered accepted

Used in conjunction with validation-set:

(use 'validateur.validations)

(validation-set
  (presence-of :name)
  (presence-of :age)
  (acceptance-of :terms))
raw docstring

child-ofcljmacro

(child-of attribute & body)

children-ofcljmacro

(children-of attribute & body)

ConvertibleToLongcljprotocol

to-longclj

(to-long o)

Convert to long

Convert to long

copy-attrclj

(copy-attr e k)
(copy-attr e k f)

defvalidatorcljmacro

(defvalidator fn-name & body)

DoubleConvertiblecljprotocol

to-doubleclj

(to-double d)

Convert to double

Convert to double

exclusion-ofclj

(exclusion-of attribute & {:keys [allow-nil in] :or {allow-nil false}})

Returns a function that, when given a map, will validate that the value of the attribute in that map is not one of the given.

Accepted options:

:allow-nil (default: false): should nil values be allowed? :in (default: nil): a collection of invalid values for the attribute

Used in conjunction with validation-set:

(use 'validateur.validations)

(validation-set (presence-of :name) (presence-of :age) (exclusion-of :status :in #{"banned" "non-activated"}))

Returns a function that, when given a map, will validate that the value of the attribute in that map is not one of the given.

Accepted options:

:allow-nil (default: false): should nil values be allowed?
:in (default: nil): a collection of invalid values for the attribute

Used in conjunction with validation-set:

(use 'validateur.validations)

(validation-set
  (presence-of :name)
  (presence-of :age)
  (exclusion-of :status :in #{"banned" "non-activated"}))
raw docstring

extend-defaultsclj

(extend-defaults defaults entry)

fetchclj

(fetch & args)

find-by-idclj

(find-by-id collection id)

format-ofclj

(format-of attribute
           &
           {:keys [allow-nil allow-blank format]
            :or {allow-nil false allow-blank false}})

Returns a function that, when given a map, will validate that the value of the attribute in that map is in the given format.

Accepted options:

:allow-nil (default: false): should nil values be allowed? :allow-blank (default: false): should blank string values be allowed? :format (default: nil): a regular expression of the format

Used in conjunction with validation-set:

(use 'validateur.validations)

(validation-set (presence-of :username) (presence-of :age) (format-of :username :format #"[a-zA-Z0-9_]")

Returns a function that, when given a map, will validate that the value of the attribute in that map is in the given format.

Accepted options:

:allow-nil (default: false): should nil values be allowed?
:allow-blank (default: false): should blank string values be allowed?
:format (default: nil): a regular expression of the format

Used in conjunction with validation-set:

(use 'validateur.validations)

(validation-set
  (presence-of :username)
  (presence-of :age)
  (format-of :username :format #"[a-zA-Z0-9_]")
raw docstring

get-id-inclj

(get-id-in m ks)

get-ids-inclj

(get-ids-in m ks)

inclusion-ofclj

(inclusion-of attribute & {:keys [allow-nil in] :or {allow-nil false}})

Returns a function that, when given a map, will validate that the value of the attribute in that map is one of the given.

Accepted options:

:allow-nil (default: false): should nil values be allowed? :in (default: nil): a collection of valid values for the attribute

Used in conjunction with validation-set:

(use 'validateur.validations)

(validation-set (presence-of :name) (presence-of :age) (inclusion-of :team :in #{"red" "blue"}))

Returns a function that, when given a map, will validate that the value of the attribute in that map is one of the given.

Accepted options:

:allow-nil (default: false): should nil values be allowed?
:in (default: nil): a collection of valid values for the attribute

Used in conjunction with validation-set:

(use 'validateur.validations)

(validation-set
  (presence-of :name)
  (presence-of :age)
  (inclusion-of :team :in #{"red" "blue"}))
raw docstring

insert!clj

(insert! collection entry)

insert-and-wait!clj

(insert-and-wait! collection entry)

intersecting-queryclj

(intersecting-query from to)
(intersecting-query from to start-key end-key)

length-ofclj

(length-of attribute
           &
           {:keys [allow-nil is within allow-blank]
            :or {allow-nil false allow-blank false}})

Returns a function that, when given a map, will validate that the value of the attribute in that map is of the given length.

Accepted options:

:allow-nil (default: false): should nil values be allowed? :allow-blank (default: false): should blank string values be allowed? :is (default: nil): an exact length, as long :within (default: nil): a range of lengths

Used in conjunction with validation-set:

(use 'validateur.validations)

(validation-set (presence-of :name) (presence-of :age) (length-of :password :within (range 6 100))

(validation-set (presence-of :name) (presence-of :age) (length-of :zip :is 5)

Returns a function that, when given a map, will validate that the value of the attribute in that map is of the given length.

Accepted options:

:allow-nil (default: false): should nil values be allowed?
:allow-blank (default: false): should blank string values be allowed?
:is (default: nil): an exact length, as long
:within (default: nil): a range of lengths

Used in conjunction with validation-set:

(use 'validateur.validations)

(validation-set
  (presence-of :name)
  (presence-of :age)
  (length-of :password :within (range 6 100))

(validation-set
  (presence-of :name)
  (presence-of :age)
  (length-of :zip :is 5)
raw docstring

map-copy-attrcljmacro

(map-copy-attr e ks)
(map-copy-attr e ks f)

nil-empty-stringsclj

(nil-empty-strings a)

numericality-ofclj

(numericality-of attribute
                 &
                 {:keys [allow-nil only-integer gt gte lt lte equal-to odd even]
                  :or
                    {allow-nil false only-integer false odd false even false}})

Returns a function that, when given a map, will validate that the value of the attribute in that map is numerical.

Accepted options:

:allow-nil (default: false): should nil values be allowed? :only-integer (default: false): should only integer values be allowed? :even (default: false): should even values be allowed? :odd (default: false): should odd values be allowed? :equal-to: accept only values equal to the given :gt: accept only values greater than the given :gte: accept only values greater than or equal to the given :lt: accept only values less than the given :lte: accept only values less than or equal to the given

Used in conjunction with validation-set:

(use 'validateur.validations)

(validation-set (presence-of :name) (presence-of :age) (numericality-of :age :only-integer true :gte 18))

Returns a function that, when given a map, will validate that the value of the attribute in that map is numerical.

Accepted options:

:allow-nil (default: false): should nil values be allowed?
:only-integer (default: false): should only integer values be allowed?
:even (default: false): should even values be allowed?
:odd (default: false): should odd values be allowed?
:equal-to: accept only values equal to the given
:gt: accept only values greater than the given
:gte: accept only values greater than or equal to the given
:lt: accept only values less than the given
:lte: accept only values less than or equal to the given

Used in conjunction with validation-set:

(use 'validateur.validations)

(validation-set
  (presence-of :name)
  (presence-of :age)
  (numericality-of :age :only-integer true :gte 18))
raw docstring

object-id-ofclj

(object-id-of attribute)

object-id-qclj

(object-id-q k id)

object-id?clj

(object-id? s)

object-idsclj

(object-ids ids)

object-ids-qclj

(object-ids-q k ids)

OBJECT_ID_REGEXclj


pack-idclj

(pack-id entry)

PotentialObjectIdcljprotocol

object-idclj

(object-id o)

Convert to object id

Convert to object id

presence-ofclj

(presence-of attribute)

Returns a function that, when given a map, will validate presence of the attribute in that map.

Used in conjunction with validation-set:

(use 'validateur.validations)

(validation-set (presence-of :name) (presence-of :age))

Returns a function that, when given a map, will validate presence of the attribute in that map.

Used in conjunction with validation-set:

(use 'validateur.validations)

(validation-set
  (presence-of :name)
  (presence-of :age))
raw docstring

start-inside-period-queryclj

(start-inside-period-query from to)
(start-inside-period-query from to start-key)

unpack-idclj

(unpack-id entry)

unpack-idsclj

(unpack-ids entries)

validate-allclj

(validate-all vs entries)

validate-object-idclj

(validate-object-id & ids)

validate-stringclj

(validate-string & strings)

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

× close