map

ReQL command: map

Command syntax

sequence1.map([sequence2, ...], function) → stream
array1.map([array2, ...], function) → array
r.map(sequence1[, sequence2, ...], function) → stream
r.map(array1[, array2, ...], function) → array

Description

Transform each element of one or more sequences by applying a mapping function to them. If map is run with two or more sequences, it will iterate for as many items as there are in the shortest sequence.

Note that map can only be applied to sequences, not single values. If you wish to apply a function to a single value/selection (including an array), use the do command.

Example: Return the first five squares.

登录查看完整内容