ArrayToObject class

$arrayToObject operator

Converts an array into a single document; the array must be either:

an array of two-element arrays where the first element is the field name, and the second element is the field value:

[ [ "item", "abc123"], [ "qty", 25 ] ]

or

an array of documents that contains two fields, k and v where:

  • The k field contains the field name.
  • The v field contains the value of the field.
Inheritance

Constructors

ArrayToObject(dynamic array)
Creates $arrayToObject operator expression

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

build() Map<String, dynamic>
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited