Skip to content

$arrayEvery

$arrayEvery will test whether all elements in the array pass the condition.

Usage

$arrayEvery[name;query;queryType?]

Parameters

FieldTypeDescriptionRequired
namestringArray name.true
querystringThe element we will be queering for every element inside the array.true
queryTypestringThe comparison operator.false

Comparison Operators

  • includes — Including
  • startsWith — Starts with
  • endsWith — Ends with
  • == — Equal to
  • != — Not equal to
  • > — Greater than
  • < — Less than
  • >= — Greater than or equal to
  • <= — Less than or equal to

Example(s)

1
client.command({
2
name: "array-every",
3
code: `
4
$arrayEvery[array;30;==]
5
$createArray[array;1;2;3;0;30]
6
`
7
// It will return "false". Cause 1 ≠ 30. You can think it as "and (&&)" logical operator.
8
});