Returns a list of all field names in a record.
| Syntax | keys(<record>) | ||
| Arguments | Name | Type | Description |
<record> | RECORD | The input record | |
| Return Type | LIST | ||
GQLRETURN keys({name: 'Alice', age: 30})
Result:
| keys({name: 'Alice', age: 30}) |
|---|
| ["name","age"] |
Returns true if the record contains the specified field.
| Syntax | recordContains(<record>, <key>) | ||
| Arguments | Name | Type | Description |
<record> | RECORD | The input record | |
<key> | STRING | The field name to check | |
| Return Type | BOOL | ||
GQLRETURN recordContains({name: 'Alice', age: 30}, 'name')
Result:
| recordContains({name: 'Alice', age: 30}, 'name') |
|---|
| true |
Returns the value of the specified field in a record.
| Syntax | recordGet(<record>, <key>) | ||
| Arguments | Name | Type | Description |
<record> | RECORD | The input record | |
<key> | STRING | The field name to retrieve | |
| Return Type | Type of the field value | ||
GQLRETURN recordGet({name: 'Alice', age: 30}, 'name')
Result:
| recordGet({name: 'Alice', age: 30}, 'name') |
|---|
| Alice |
Returns a new record with the specified field removed.
| Syntax | recordRemove(<record>, <key>) | ||
| Arguments | Name | Type | Description |
<record> | RECORD | The input record | |
<key> | STRING | The field name to remove | |
| Return Type | RECORD | ||
GQLRETURN recordRemove({name: 'Alice', age: 30}, 'age')
Result:
| recordRemove({name: 'Alice', age: 30}, 'age') |
|---|
| {name: "Alice"} |
Returns a new record with the specified field set to the given value.
| Syntax | recordSet(<record>, <key>, <value>) | ||
| Arguments | Name | Type | Description |
<record> | RECORD | The input record | |
<key> | STRING | The field name to set | |
<value> | Any | The value to assign to the field | |
| Return Type | RECORD | ||
GQLRETURN recordSet({name: 'Alice'}, 'age', 30)
Result:
| recordSet({name: 'Alice'}, 'age', 30) |
|---|
| {name: "Alice", age: 30} |