Skip to content

Latest commit

 

History

History
34 lines (27 loc) · 757 Bytes

File metadata and controls

34 lines (27 loc) · 757 Bytes
layout language permalink command io related_commands
api-command
JavaScript
api/javascript/keys/
keys
singleSelection
array
object
array
values
values/

Command syntax

{% apibody %} singleSelection.keys() → array object.keys() → array {% endapibody %}

Description

Return an array containing all of an object's keys. Note that the keys will be sorted as described in ReQL data types (for strings, lexicographically).

Example: Get all the keys from a table row.

// row: { id: 1, mail: "fred@example.com", name: "fred" }

r.table('users').get(1).keys().run(conn, callback);
// Result passed to callback
[ "id", "mail", "name" ]