Skip to content
This repository was archived by the owner on Dec 13, 2023. It is now read-only.
This repository was archived by the owner on Dec 13, 2023. It is now read-only.

AQL documentation mistakenly states empty arrays & objects are falsy #626

@obataku

Description

@obataku

https://www.arangodb.com/docs/stable/aql/fundamentals-data-types.html#null-value

A null value can be used to represent an empty or absent value. It is different from a numerical value of zero (null != 0) and other falsy values (false, zero-length string, empty array or object). It is also known as nil or None in other languages.

cf the section on logical operators:
https://www.arangodb.com/docs/stable/aql/operators.html#logical-operators

Passing non-boolean values to a logical operator is allowed. Any non-boolean operands
will be casted to boolean implicitly by the operator, without making the query abort.

The conversion to a boolean value works as follows:

  • null will be converted to false
  • boolean values remain unchanged
  • all numbers unequal to zero are true, zero is false
  • an empty string is false, all other strings are true
  • arrays ([ ]) and objects / documents ({ }) are true, regardless of their contents

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions