Liking cljdoc? Tell your friends :D

cmql-core.operators.operators


*clj/s

(* & exprs)

$multiply Multiply numbers Call (* 1 2.3 5)

$multiply
Multiply numbers
Call
(* 1 2.3 5)
sourceraw docstring

+clj/s

(+ & es)

$add Add numbers or numbers(milliseconds) to dates Call (+_ 1 2) (+_ :adate (*_ 5 60 1000))

$add
Add numbers or numbers(milliseconds) to dates
Call
(+_ 1 2)
(+_ :adate (*_ 5 60 1000))
sourceraw docstring

-clj/s

(- e-n)
(- e-n & es)

$substract Substract numbers or numbers(milliseconds) to dates Call (- 2 1) (- :adate (*_ 5 60 1000))

$substract
Substract numbers or numbers(milliseconds) to dates
Call
(- 2 1)
(- :adate (*_ 5 60 1000))
sourceraw docstring

<clj/s

(< e1 e2)

$lt

$lt
sourceraw docstring

<=clj/s

(<= e1 e2)

$lte

$lte
sourceraw docstring

=clj/s

(= e1 e2 & es)

$eq Check for equality, works on all types

$eq
Check for equality, works on all types
sourceraw docstring

=setsclj/s

(=sets & args)

$setEquals

$setEquals
sourceraw docstring

>clj/s

(> e1 e2)

$gt

$gt
sourceraw docstring

>=clj/s

(>= e1 e2)

$gte

$gte
sourceraw docstring

absclj/s

(abs e-n)

$abs

$abs
sourceraw docstring

all-true?clj/s

(all-true? e-array)

$allElementsTrue

$allElementsTrue
sourceraw docstring

andclj/s

(and & es)

$and Logical and,short circuit,false if one false/0/null/undefined

$and
Logical and,short circuit,false if one false/0/null/undefined
sourceraw docstring

any-true?clj/s

(any-true? e-array)

$anyElementTrue

$anyElementTrue
sourceraw docstring

array?clj/s

(array? e-array)

$isArray

$isArray
sourceraw docstring

assocclj/s

(assoc array-or-doc index value)

if the index/key is variable,i give it as {:key variable-e} or {:index variable-e}

if the index/key is variable,i give it as {:key variable-e} or {:index variable-e}
sourceraw docstring

assoc-inclj/s

(assoc-in array-or-doc indexes value)
source

assoc-object-clj/s

(assoc-object- doc key-e-string value-e)
source

avgclj/s

(avg group-or-array-e)
(avg e1 e2 & es)

$avg Can be used in $group $match if inside {$expr ...} $addFields=$set $project=$unset $replaceRoot=$replaceWith Ignores non numeric(doesnt count as members) if all non-numeric returns null Call (avg- e) ; the array is made from group 1e/member (avg- array) (avg- number1 number2 ...)

$avg
Can be used in
$group
$match if inside {$expr ...}
$addFields=$set
$project=$unset
$replaceRoot=$replaceWith
Ignores non numeric(doesnt count as members)
if all non-numeric returns null
Call
(avg- e) ; the array is made from group 1e/member
(avg- array)
(avg- number1 number2 ...)
sourceraw docstring

booleanclj/s

(boolean e)

$toBool

$toBool
sourceraw docstring

boolean?clj/s

(boolean? e)
source

bson-sizeclj/s

(bson-size e-doc)
source

ceilclj/s

(ceil e-n)

$ceil

$ceil
sourceraw docstring

cmpclj/s

(cmp e1 e2)

$cmp Compares value, works on all types Returns 1 if e1>e2 , -1 if e1<e2 , 0 if e1=e2

$cmp
Compares value, works on all types
Returns 1 if e1>e2 , -1 if e1<e2 , 0 if e1=e2
sourceraw docstring

cmp-str-icaseclj/s

(cmp-str-icase e1-string e2-string)

$strcasecmp string equality ignore case

$strcasecmp
string equality ignore case
sourceraw docstring

compile-functionsclj/s

(compile-functions f-name & f-names)

Compiles one cljs to one javascript function with the same name. The javascript function code,is saved in js/f-name.js The default location to look for js code

Compiles one cljs to one javascript function with the same name.
The javascript function code,is saved in   js/f-name.js
The default location to look for js code
sourceraw docstring

concatclj/s

(concat & e-arrays)

$concatArrays Concatenates arrays to return the concatenated array. If any of the argument is null returns null

$concatArrays
Concatenates arrays to return the concatenated array.
If any of the argument is null returns null
sourceraw docstring

condclj/s

(cond & args)

$switch Call (cond- cond1 e1 ; cond1=boolean-e cond2 e2 ... :else en)

$switch
Call
(cond- cond1 e1   ; cond1=boolean-e
       cond2 e2
       ...
       :else en)
sourceraw docstring

conjclj/s

(conj e-array e)

Like $push but implemented with concat- Not O(1) $push works only in group

Like $push but implemented with concat-
Not O(1) $push works only in group
sourceraw docstring

conj-atclj/s

(conj-at ar index value)
source

conj-distinctclj/s

(conj-distinct e-array e)

Slow contains?- is not O(1) If order not important,add get distinct after

Slow contains?- is not O(1)
If order not important,add get distinct after
sourceraw docstring

conj-eachclj/s

(conj-each e)

$push Used only in $group Run 1 time/ member of the group Adds the member at the end of the acc array

$push
Used only in $group
Run 1 time/ member of the group
Adds the member at the end of the acc array
sourceraw docstring

conj-each-distinctclj/s

(conj-each-distinct e)

$addToSet Used only in $group Run 1 time/ member of the group Adds new member on the acc array only if not exists already

$addToSet
Used only in $group
Run 1 time/ member of the group
Adds new member on the acc array only if not exists already
sourceraw docstring

contains?clj/s

(contains? e-array e)

$in True is e is member(not index) of e-array

$in
True is e is member(not index) of e-array
sourceraw docstring

convertclj/s

(convert input-e e-type & args)

$convert Converts an expression to the type i specify using the type etype = double/string/objectId/bool/timestamp/date/int/long/decimal I can use the string representation of type or the number Call (convert- 1.99999 'bool') (convert- any-e 'bool' {:onError e1} {:onNull e2}) ;; optional

$convert
Converts an expression to the type i specify using the type
etype = double/string/objectId/bool/timestamp/date/int/long/decimal
I can use the string representation of type or the number
Call
(convert- 1.99999 'bool')
(convert- any-e 'bool' {:onError e1} {:onNull e2})  ;; optional
sourceraw docstring

countclj/s

(count e-array)

$size

$size
sourceraw docstring

count-aclj/s

(count-a)
source

count-strclj/s

(count-str e-s)

$strLenCP

$strLenCP
sourceraw docstring

count-str-bytesclj/s

(count-str-bytes e-s)
source

dateclj/s

(date e)
source

date-addclj/s

(date-add op-map)

$dateAdd

$dateAdd
sourceraw docstring

date-diffclj/s

(date-diff op-map)

$dateDiff

$dateDiff
sourceraw docstring

date-from-partsclj/s

(date-from-parts op-map)

$dateFromParts

$dateFromParts
sourceraw docstring

date-from-stringclj/s

(date-from-string date-str & options)

$dateFromString

$dateFromString
sourceraw docstring

date-hourclj/s

(date-hour e-date)
source

date-millisecondclj/s

(date-millisecond e-date)
source

date-minuteclj/s

(date-minute e-date)
source

date-monthclj/s

(date-month e-date)
source

date-secondclj/s

(date-second e-date)
source

date-subtractclj/s

(date-subtract op-map)

$dateSubtract

$dateSubtract
sourceraw docstring

date-to-partsclj/s

(date-to-parts op-map)

$dateToParts

$dateToParts
sourceraw docstring

date-to-stringclj/s

(date-to-string op-map)
source

date-truncclj/s

(date-trunc date-doc)
source

date-weekclj/s

(date-week e-date)
source

date-yearclj/s

(date-year e-date)
source

date?clj/s

(date? e)
source

day-of-monthclj/s

(day-of-month e-date)
source

day-of-weekclj/s

(day-of-week e-date)
source

day-of-yearclj/s

(day-of-year e-date)
source

decclj/s

(dec e)
source

decimalclj/s

(decimal e)

$toDecimal

$toDecimal
sourceraw docstring

decimal?clj/s

(decimal? e)
source

dense-rankclj/s

(dense-rank)
source

differenceclj/s

(difference e-array1 e-array2)

$setDifference

$setDifference
sourceraw docstring

disjoint?clj/s

(disjoint? e-array1 e-array2)

No common

No common
sourceraw docstring

dissocclj/s

(dissoc array-or-doc index)
source

dissoc-inclj/s

(dissoc-in array-or-doc indexes)
source

divclj/s

(div e-n)
(div e-n & es)

$divide

$divide
sourceraw docstring

doubleclj/s

(double e)

$toDouble

$toDouble
sourceraw docstring

double?clj/s

(double? e)
source

ejsclj/s

(ejs njs-code)
(ejs f-name f-args & f-code)

Execute the javascript code,calls $function operator Used in 2 ways execute nested js => 1 argument execute code from file or argument => 2 or 3+ arguments

Call 1 argument

No wrappers 1 nested call (no need for njs use ejs with 3+ arguments directly) (ejs (njs f-name f-args f-code))

No wrappers 2 nested call (hard to read,use wrappers instead) (ejs :assoc_j [(njs :assoc_j [:myobject 'akey' 'avalue']) ;; doc after first call (nested) 'akey1' 'avalue1'])

Wrappers (here all functions use njs on their body)(usefull for nested calls) The prefered way,makes it look like regular MongoQL operator

(ejs (dissoc-j (assoc-j (assoc-j :mydoc 'e' 5) 'f' 6) 'f'))

assoc-j or dissoc-j wrapper uses njs (defn assoc-cj [doc k v] (njs :assoc_cj [doc k v]))

Call 2 arguments

Assumes that the js/fname.js already exists so no need for code (ejs :assoc_j [:myobject 'akey' 'avalue']

Call 3+ arguments

If javascript saves the code in js/fname.js If Clojurescript compiles and saves the code in js/fname.js Then execute the code,with $function (if code is given old-code is replaced if js/fname.js already existed)

fname(string/keyword),f-args vector,function-boy(each line can be 1 arg)

Javascript

(ejs :assoc_j [:myobject 'akey' 'avalue'] 'function assoc_j (a,k,v) {' ' a[k]=v; return a;}')

ClojureScript

(ejs :assoc_cj [:myobject 'akey' 'avalue'] '(defn assoc_cj [a k v] (do (aset a k v) a)))

Execute the javascript code,calls $function operator
Used in 2 ways
execute nested js => 1 argument
execute code from file or argument => 2 or 3+ arguments

Call 1 argument

No wrappers 1 nested call (no need for njs use ejs with 3+ arguments directly)
 (ejs (njs f-name f-args f-code))

No wrappers 2 nested call (hard to read,use wrappers instead)
  (ejs :assoc_j
       [(njs :assoc_j [:myobject 'akey' 'avalue']) ;; doc after first call (nested)
       'akey1'
       'avalue1'])

Wrappers (here all functions use njs on their body)(usefull for nested calls)
The prefered way,makes it look like regular MongoQL operator

  (ejs (dissoc-j (assoc-j (assoc-j :mydoc 'e' 5) 'f' 6) 'f'))

  assoc-j or dissoc-j wrapper uses njs
  (defn assoc-cj [doc k v]
    (njs :assoc_cj [doc k v]))

Call 2 arguments

Assumes that the js/fname.js already exists so no need for code
(ejs :assoc_j [:myobject 'akey' 'avalue']

Call 3+ arguments

If javascript saves the code in   js/fname.js
If Clojurescript compiles and saves the code in  js/fname.js
Then execute the code,with $function
(if code is given old-code is replaced if js/fname.js already existed)

fname(string/keyword),f-args vector,function-boy(each line can be 1 arg)

Javascript

(ejs :assoc_j
     [:myobject 'akey' 'avalue']
     'function assoc_j (a,k,v) {'
     ' a[k]=v; return a;}')

ClojureScript

(ejs :assoc_cj
     [:myobject 'akey' 'avalue']
    '(defn assoc_cj [a k v]
       (do (aset a k v) a)))
sourceraw docstring

empty?clj/s

(empty? e-array)
source

exists?clj/s

(exists? e)

$type True if field exists (not=_ (type- e) 'missing')

$type
True if field exists (not=_ (type- e) 'missing')
sourceraw docstring

expclj/s

(exp e-n)

$exp e(Euler’s number) pow e-n

$exp
e(Euler’s number) pow e-n
sourceraw docstring

exprclj/s

(expr aggregation-e)

$expr Converts an aggregate expression to a query expression For example i can use aggregate operators in a match stage Allows us to use aggregate operators instead of query operators

$expr
Converts an aggregate expression to a query expression
For example i can use aggregate operators in a match stage
Allows us to use aggregate operators instead of query operators
sourceraw docstring

false?clj/s

(false? e)
source

filterclj/s

(filter cond-fn e-array)

$filter Call (filter (fn [:n.] (> :n. 0)) :myarray)

$filter
Call
(filter  (fn [:n.] (> :n. 0)) :myarray)
sourceraw docstring

firstclj/s

(first e-group)

$first Used only in $group Take the first member of the group. Only used at $group(in arrays i use (get- ar 0)) If data were sorted on the keys that i group by i take the smallest else random

$first
Used only in $group
Take the first member of the group.
Only used at $group(in arrays i use (get- ar 0))
If data were sorted on the keys that i group by i take the smallest
else random
sourceraw docstring

floorclj/s

(floor e-n)

$floor

$floor
sourceraw docstring

fnclj/s

(fn args body)

fn- like Clojure fn Used only in map/filter/reduce , only as argument Call (fn- [:avar.] ...) ; map/filter 1 arg (fn- [:avar. :bvar.] ...) ; reduce 2 args *if argument is :this. or :value. no let(reduce) and not :as(filter/map) , is used.

Reduce example (reduce (fn [:sum. :n.] (+ :sum. :n.)) [] :myarray)

fn- like Clojure fn
Used only in map/filter/reduce , only as argument
Call
(fn- [:avar.] ...)         ; map/filter 1 arg
(fn- [:avar. :bvar.] ...)  ; reduce 2 args
*if argument is :this. or :value. no let(reduce)
 and not :as(filter/map) , is used.

Reduce example
(reduce (fn [:sum. :n.] (+ :sum. :n.)) [] :myarray)
sourceraw docstring

getclj/s

(get array-or-doc index)
source

get-fieldclj/s

(get-field doc field)
source

get-inclj/s

(get-in array-or-doc indexes)
source

identityclj/s

(identity e)

returns its argument, useful when we want to use an array as argument

returns its argument, useful when we want to use an array as argument
sourceraw docstring

if-clj/s

(if- e-b e1 e2)

$cond Call (if- e-b e1 e2)

$cond
Call
(if- e-b e1 e2)
sourceraw docstring

if-notclj/s

(if-not e-b e1 e2)

$cond e1 when e-b false Call (if-not e-b e1 e2)

$cond
e1 when e-b false
Call
(if-not e-b e1 e2)
sourceraw docstring

if-not-valueclj/s

(if-not-value e nill-e)

$ifNull Equivalent with (e nil or e not exist) (if- (not-value?- e) nill-e e)

$ifNull
Equivalent with (e nil or e not exist)
(if- (not-value?- e) nill-e e)
sourceraw docstring

incclj/s

(inc e)
source

index-ofclj/s

(index-of e-array e)
(index-of e-array e start)
(index-of e-array e start end)

$indexOfArray Returns the index of the matching member,or -1. I can search in a range only,of the array, for example from index=5 to index=10

$indexOfArray
Returns the index of the matching member,or -1.
I can search in a range only,of the array, for example from index=5 to index=10
sourceraw docstring

index-of-in-bytesclj/s

(index-of-in-bytes e-s sub-e-s)
(index-of-in-bytes e-s sub-e-s start)
(index-of-in-bytes e-s sub-e-s start end)

$indexOfBytes UTF-8 byte index of the first occurrence or -1

$indexOfBytes
UTF-8 byte index of the first occurrence or -1
sourceraw docstring

index-of-strclj/s

(index-of-str e-s sub-e-s)
(index-of-str e-s sub-e-s start)
(index-of-str e-s sub-e-s start end)

$indexOfCP UTF-8 code point index of the first occurrence or -1

$indexOfCP
UTF-8 code point index of the first occurrence or -1
sourceraw docstring

intclj/s

(int e)

$toInt

$toInt
sourceraw docstring

int?clj/s

(int? e)
source

intersectionclj/s

(intersection & args)

$setIntersection

$setIntersection
sourceraw docstring

intoclj/s

(into into-type array-or-doc-e)
source

iso-day-of-weekclj/s

(iso-day-of-week e-date)
source

iso-weekclj/s

(iso-week e-date)
source

iso-week-yearclj/s

(iso-week-year e-date)
source

lastclj/s

(last e-group)

$last Used only in $group Take the last member of the group. Only used at $group(in arrays i use (get- ar (-_ (count- ar) 1))) If data were sorted on the keys that i group by i take the largest else random

$last
Used only in $group
Take the last member of the group.
Only used at $group(in arrays i use (get- ar (-_ (count- ar) 1)))
If data were sorted on the keys that i group by i take the largest
else random
sourceraw docstring

letclj/s

(let vars body)

$let Allows depended variables => generate minimun nested mongo $let Call (let- [:x- 2 :y- 1 :z- (+_ :y- :x-)] :z-)

$let
Allows depended variables => generate minimun nested mongo $let
Call
(let- [:x- 2
       :y- 1
       :z- (+_ :y- :x-)]
  :z-)
sourceraw docstring

leticlj/s

(leti vars body)

$let Not usefull,like let- but not allows dependent variables Call (leti- [:v1- e1 :v2- e2] e)

$let
Not usefull,like let- but not allows dependent variables
Call
(leti- [:v1- e1 :v2- e2] e)
sourceraw docstring

literalclj/s

(literal e)

$literal Used to show that it represents it self,without special MQL meaning. Call (literal- :a) => will mean a string '$a' not a field reference {$project {:myfield {$literal 1}}} => adds :myfield with value 1

$literal
Used to show that it represents it self,without special MQL meaning.
Call
(literal- :a) => will mean a string '$a' not a field reference
{$project {:myfield {$literal 1}}} => adds :myfield with value 1
sourceraw docstring

lnclj/s

(ln e-n)

$ln

$ln
sourceraw docstring

logclj/s

(log e-n)
(log e-n base)

$log log10 if no base

$log
log10 if no base
sourceraw docstring

longclj/s

(long e)

$toLong

$toLong
sourceraw docstring

long?clj/s

(long? e)
source

lower-caseclj/s

(lower-case e-s)

$toLower

$toLower
sourceraw docstring

mapclj/s

(map map-fn e-array)

$map Call (map (fn [:n.] (+ :n. 1)) :myarray)

$map
Call
(map  (fn [:n.] (+ :n. 1)) :myarray)
sourceraw docstring

maxclj/s

(max group-or-array-e)
(max e1 e2 & es)

$max Can be used in $group $match if inside {$expr ...} $addFields=$set $project=$unset $replaceRoot=$replaceWith Compares(using $cmp) and returns the max With 1 argument its always group or array, else >1 argument Call (max- e) ; the array is made from group 1e/member (max- array) (max- number1 number2 ...)

$max
Can be used in
$group
$match if inside {$expr ...}
$addFields=$set
$project=$unset
$replaceRoot=$replaceWith
Compares(using $cmp) and returns the max
With 1 argument its always group or array, else >1 argument
Call
(max- e)  ; the array is made from group 1e/member
(max- array)
(max- number1 number2 ...)
sourceraw docstring

mergeclj/s

(merge group-or-array-e)
(merge e1 e2 & es)

$mergeObjects

$mergeObjects
sourceraw docstring

minclj/s

(min group-or-array-e)
(min e1 e2 & es)

$min Can be used in $group $match if inside {$expr ...} $addFields=$set $project=$unset $replaceRoot=$replaceWith Compares(using $cmp) and returns the min Call (min- e) ; the array is made from group 1e/member (min- array) (min- number1 number2 ...)

$min
Can be used in
$group
$match if inside {$expr ...}
$addFields=$set
$project=$unset
$replaceRoot=$replaceWith
Compares(using $cmp) and returns the min
Call
(min- e)   ; the array is made from group 1e/member
(min- array)
(min- number1 number2 ...)
sourceraw docstring

modclj/s

(mod e1-n e2-n)

$mod

$mod
sourceraw docstring

nil?clj/s

(nil? e)
source

njsclj/s

(njs f-name f-args & f-code)

Makes many nested javascirpt calls,1 javascript function => 1 $function call Its for optimization,and much faster. In MongoDB n nested calls => n $function calls Using njs it can be 1 $function call

Allows wrapping of js code,to make it look like MongoQL/Clojure code. The 3 nested calls will be 1 $function call,and looks like normal aggregation operators. (add 2 key-value pairs to a doc,and remove one)

(ejs (dissoc-j (assoc-j (assoc-j :mydoc 'e' 5) 'f' 6) 'f'))

After finishing with the nesting use ejs to execute the function. Call No wrapper,call it from query (ejs (njs f-name f-args f-code))

Wrapper call it on wrapper defn (here on njs no code is given assumes js/assoc_j.js exists) (defn assoc-j [doc k v] (njs :assoc_j [doc k v]))

Use the wrapper in the query (ejs (assoc-j :mydoc 'akey' 'avalue')

Makes many nested javascirpt calls,1 javascript function => 1 $function call
Its for optimization,and much faster.
In MongoDB n nested calls => n $function calls
Using njs it can be 1 $function call

Allows wrapping of js code,to make it look like MongoQL/Clojure code.
The 3 nested calls will be 1 $function call,and looks like normal aggregation operators.
(add 2 key-value pairs to a doc,and remove one)

 (ejs (dissoc-j (assoc-j (assoc-j :mydoc 'e' 5) 'f' 6) 'f'))

After finishing with the nesting use ejs to execute the function.
Call
  No wrapper,call it from query
  (ejs (njs f-name f-args f-code))

  Wrapper call it on wrapper defn (here on njs no code is given assumes js/assoc_j.js exists)
   (defn assoc-j [doc k v]
    (njs :assoc_j [doc k v]))

  Use the wrapper in the query
  (ejs (assoc-j :mydoc 'akey' 'avalue')
sourceraw docstring

norclj/s

(nor & es)

$not $or (not- (or- ...))

$not $or
(not- (or- ...))
sourceraw docstring

notclj/s

(not e)

$not Logical not,true if not (false/0/null/undefined)

$not
Logical not,true if not (false/0/null/undefined)
sourceraw docstring

not-disjoint?clj/s

(not-disjoint? e-array1 e-array2)

At least 1 common

At least 1 common
sourceraw docstring

not-empty?clj/s

(not-empty? e-array)
source

not-exists?clj/s

(not-exists? e)

True if field missing (=_ (type- e) 'missing')

True if field missing (=_ (type- e) 'missing')
sourceraw docstring

not-value?clj/s

(not-value? e)
source

not=clj/s

(not= e1 e2)
(not= e1 e2 & es)

$ne

$ne
sourceraw docstring

number?clj/s

(number? e)
source

object-idclj/s

(object-id e)

$toObjectId

$toObjectId
sourceraw docstring

object-id?clj/s

(object-id? e)
source

object?clj/s

(object? e)
source

operators-mappingsclj/s

source

orclj/s

(or & es)

$or Logical or,short circuit,false all false/0/null/undefined

$or
Logical or,short circuit,false all false/0/null/undefined
sourceraw docstring

powclj/s

(pow e1-n e2-n)

$pow

$pow
sourceraw docstring

randclj/s

(rand)
source

rangeclj/s

(range end-e-integer)
(range start-e-integer end-e-integer)
(range start-e-integer end-e-integer step-e-integer)

$range Produces array of integers range(start end step) step defaults to 1 start defaults to 0

$range
Produces array of integers range(start end step)
step defaults to 1
start defaults to 0
sourceraw docstring

rankclj/s

(rank)
source

re-findclj/s

(re-find pattern-expression string-s-expression)
(re-find pattern-expression string-s-expression options)

$regexFind

$regexFind
sourceraw docstring

re-find?clj/s

(re-find? pattern-expression string-s-expression)
(re-find? pattern-expression string-s-expression options)

$regexMatch

$regexMatch
sourceraw docstring

re-seqclj/s

(re-seq pattern-expression string-s-expression)
(re-seq pattern-expression string-s-expression options)

$regexFindAll

$regexFindAll
sourceraw docstring

reduceclj/s

(reduce in-rfn init-e input-e-array)

$reduce Call (reduce- (fn [:sum. :n.] (+ :sum. :n.)) [] :myarray)

$reduce
Call
(reduce- (fn [:sum. :n.] (+ :sum. :n.)) [] :myarray)
sourceraw docstring

regex?clj/s

(regex? e)
source

replaceclj/s

(replace s str-e replacement)

$replaceOne match is string not pattern

$replaceOne
match is string not pattern
sourceraw docstring

replace-allclj/s

(replace-all s str-e replacement)

$replaceAll match is string not pattern

$replaceAll
match is string not pattern
sourceraw docstring

reverseclj/s

(reverse e-array)

$reverseArray reverses an array,if null => null

$reverseArray
reverses an array,if null => null
sourceraw docstring

roundclj/s

(round e-n)
(round e-n place-e-n)

$round e-n integer, double, decimal, or long place-e-n = -20 < e-n < 100 default=0 if missing

$round
e-n  integer, double, decimal, or long
place-e-n = -20 < e-n < 100  default=0 if missing
sourceraw docstring

set-fieldclj/s

(set-field doc field value)
source

some?clj/s

(some? e)

True if not nil

True if not nil
sourceraw docstring

splitclj/s

(split e1-string e2-string)

$split splits on e2-string(no regex) returns array

$split
splits on e2-string(no regex) returns array
sourceraw docstring

sqrtclj/s

(sqrt e-n)

$sqrt

$sqrt
sourceraw docstring

stdDevPopclj/s

(stdDevPop group-or-array-e)
(stdDevPop e1 e2 & es)

$stdDevPop

$stdDevPop
sourceraw docstring

stdDevSampclj/s

(stdDevSamp group-or-array-e)
(stdDevSamp e1 e2 & es)

$stdDevSamp

$stdDevSamp
sourceraw docstring

strclj/s

(str & es-s)

$concat Concatenates any number of strings,if 1 or more null => null

$concat
Concatenates any number of strings,if 1 or more null => null
sourceraw docstring

stringclj/s

(string e)

$toString

$toString
sourceraw docstring

string?clj/s

(string? e)
source

subsclj/s

(subs e-s start-e-n)
(subs e-s start-e-n end-e-n)

$substrCP Take the substring,starting from start to end UTF8 indexes Counts in UTF-8 code points,negatives indexes are not allowed Call like Clojure's subs (subs s start) ;; end=string size (subs s start end)

$substrCP
Take the substring,starting from start to end UTF8 indexes
Counts in UTF-8 code points,negatives indexes are not allowed
Call like Clojure's subs
(subs s start)            ;; end=string size
(subs s start end)
sourceraw docstring

subs-bytesclj/s

(subs-bytes e-s start-e-n end-e-n)

$substrBytes Take the substring,starting from start to end BYTES indexes Counts in BYTES,negatives indexes are not allowed Call like Clojure's subs (subs s start) ;; end=string size (subs s start end)

$substrBytes
Take the substring,starting from start to end BYTES indexes
Counts in BYTES,negatives indexes are not allowed
Call like Clojure's subs
(subs s start)     ;; end=string size
(subs s start end)
sourceraw docstring

subset?clj/s

(subset? subset-e-array1 e-array2)

$setIsSubset

$setIsSubset
sourceraw docstring

subvecclj/s

(subvec e-array start-e-n)
(subvec e-array start-e-n end-e-n)

uses $slic but works like clojure subvec Call (subvec [1 2 3 4 5 6 7] 2 4) = 3,4 Limit cases start>count => empty array (slice do that alone) Doesn't do circles if index>count,just takes till the end cMQL's take works like slice,see take

uses $slic but works like clojure subvec
Call
(subvec [1 2 3 4 5 6 7] 2 4)   = 3,4
Limit cases
 start>count => empty array (slice do that alone)
Doesn't do circles if index>count,just takes till the end
cMQL's take works like slice,see take
sourceraw docstring

sumclj/s

(sum group-or-array-e)
(sum e1 e2 & es)

$sum Can be used in $group $match if inside {$expr ...} $addFields=$set $project=$unset $replaceRoot=$replaceWith Ignores non numeric,if all non-numeric returns 0 Call (sum- e) ; the array is made from group 1e/member (sum- array) (sum- number1 number2 ...)

$sum
Can be used in
$group
$match if inside {$expr ...}
$addFields=$set
$project=$unset
$replaceRoot=$replaceWith
Ignores non numeric,if all non-numeric returns 0
Call
(sum- e)   ; the array is made from group 1e/member
(sum- array)
(sum- number1 number2 ...)
sourceraw docstring

takeclj/s

(take n e-array)
(take start-index n e-array)

$slice works like MQL slice,instead of indexes we give number of elements we want but different argument order

$slice
works like MQL slice,instead of indexes we give number of elements we want
but different argument order
sourceraw docstring

take-strclj/s

(take-str n e-str)
(take-str start-index n e-str)

$substrCP works like MQL substrCP, but different argument order

$substrCP
works like MQL substrCP, but different argument order
sourceraw docstring

trimclj/s

(trim e-string)
(trim e-string trim-e-string)

$trim Deletes the characters ofr trim-e-string from the end and from start Character order in trim-e-string is ignored,its char1 or char2 ... and i can have multiple matches.Stop deleting when no match. for example gggddeee ged will reutrn '' delete all chars

$trim
Deletes the characters ofr trim-e-string from the end and from start
Character order in trim-e-string is ignored,its char1 or char2 ...
and i can have multiple matches.Stop deleting when no match.
for example  gggddeee ged  will reutrn '' delete all chars
sourceraw docstring

trimlclj/s

(triml e-string)
(triml e-string trim-e-string)

$ltrim Deletes the characters ofr trim-e-string from the start Character order in trim-e-string is ignored,its char1 or char2 ... and i can have multiple matches.Stop deleting when no match. for example gggddeee ged will reutrn '' delete all chars

$ltrim
Deletes the characters ofr trim-e-string from the start
Character order in trim-e-string is ignored,its char1 or char2 ...
and i can have multiple matches.Stop deleting when no match.
for example  gggddeee ged  will reutrn '' delete all chars
sourceraw docstring

trimrclj/s

(trimr e-string)
(trimr e-string trim-e-string)

$rtrim Deletes the characters ofr trim-e-string from the end Character order in trim-e-string is ignored,its char1 or char2 ... and i can have multiple matches.Stop deleting when no match. for example gggddeee ged will reutrn '' delete all chars

$rtrim
Deletes the characters ofr trim-e-string from the end
Character order in trim-e-string is ignored,its char1 or char2 ...
and i can have multiple matches.Stop deleting when no match.
for example  gggddeee ged  will reutrn '' delete all chars
sourceraw docstring

true?clj/s

(true? e)
source

truncclj/s

(trunc e-n)
(trunc e-n place-e-n)

$trunc e-n integer, double, decimal, or long place-e-n = -20 < e-n < 100 default=0 if missing like round,but just removes,not round

$trunc
e-n integer, double, decimal, or long
place-e-n = -20 < e-n < 100  default=0 if missing
like round,but just removes,not round
sourceraw docstring

typeclj/s

(type e)

$type Returns a string representation of the argument type

$type
Returns a string representation of the argument type
sourceraw docstring

unionclj/s

(union & args)

$setUnion

$setUnion
sourceraw docstring

unset-fieldclj/s

(unset-field doc field)
source

upper-caseclj/s

(upper-case e-s)

$toUpper

$toUpper
sourceraw docstring

value?clj/s

(value? e)
source

ziparrayclj/s

(ziparray & args)

$zip Arguments are arrays. [[firsts of all arrays] [seconds of all arays] ...] if array not same sizes,the nth values dont added to result at all if useLongestLength (default is false) results = largest array size else results = smaller array size(if i dont have from not added in result) If not useLongestLength i always have elements to add from all arrays. If useLongestLength i give defaults,else defaults = [nil ...] defaults = defaults must have the same size as the number of arrays array that i take elements in order,to add to smaller arrays Call (ziparray- [a1 a2 a3] [b1 b2 b3] [c1 c2 c3]) => [[a1 b1 c1] [a2 b2 c2] [a3 b3 c3]

$zip
Arguments are arrays.
[[firsts of all arrays] [seconds of all arays] ...]
if array not same sizes,the nth values dont added to result at all
if useLongestLength (default is false)
  results = largest array size
else
  results = smaller array size(if i dont have from not added in result)
If not useLongestLength i always have elements to add from all arrays.
If useLongestLength i give defaults,else defaults = [nil ...]
defaults = defaults must have the same size as the number of arrays
array that i take elements in order,to add to smaller arrays
Call
(ziparray- [a1 a2 a3] [b1 b2 b3] [c1 c2 c3])
=>
[[a1 b1 c1] [a2 b2 c2] [a3 b3 c3]
sourceraw docstring

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

× close