Skip to content

$and

$and will check if all given conditions are true.

Usage

$and[...conditions]

Parameters

FieldTypeDescriptionRequired
…conditionsstringThe conditions you want to check.true

Example(s)

This will check if the three given conditions are true:

  1. $authorId==$authorId -> true
  2. 1>=1 -> true
  3. $packageVersion==1.0.0 -> false

As you can see, one condition is false.

1
client.command({
2
name: "and",
3
code: `
4
$and[$authorId==$authorId;1>=1;$packageVersion==1.0.0]` // returns: false
5
});

Another example but with it returning true would be:

This will check if the three given conditions are true:

  1. $authorId==$authorId -> true
  2. 1>=1 -> true
  3. $packageVersion==6.7.0 -> true

As you can see, all conditions are true.

1
client.command({
2
name: "and",
3
code: `
4
$and[$authorId==$authorId;1>=1;$packageVersion==6.7.0]` // returns: true
5
});