docs/api/javascript/document-manipulation/prepend.md at master · rethinkdb/docs

Latest commit

layout api-command
language JavaScript
permalink api/javascript/prepend/
command prepend
io

array

array

related_commands
append insertAt deleteAt changeAt merge

append/

insert_at/

delete_at/

change_at/

merge/

Command syntax

{% apibody %} array.prepend(value) → array {% endapibody %}

Description

Prepend a value to an array.

Example: Retrieve Iron Man's equipment list with the addition of some new boots.

r.table('marvel').get('IronMan')('equipment').prepend('newBoots').run(conn, callback)