> For the complete documentation index, see [llms.txt](https://doc.duaer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.duaer.com/code/builtin/data-transformation-functions/objects.md).

# Object transformation methods in Duaer

In a Duaer expression, object methods test fields, drop fields, merge objects, and encode an object as a query string.
## Methods

- keys() returns the field names. values() returns the values.
- hasField(name) says whether that field exists (top-level only, case-sensitive).
- isEmpty() and isNotEmpty() treat an object with no fields as empty.
- compact() drops fields whose values are empty.
- removeField(name) removes one field.
- keepFieldsContaining(text) and removeFieldsContaining(text) keep or drop fields whose names contain that text.
- merge(other) merges another object. The other object wins on a shared field name.
- toJsonString() returns a JSON string.
- urlEncode() encodes the object as a URL query string.

```
{{ $json.address.hasField("city") }}
```
## Questions

### What does hasField test in Duaer?

In a Duaer expression, whether that field exists (top-level only, case-sensitive). keys() returns field names; values() returns the values.

### Which value wins on merge in Duaer when both objects share a field?

In a Duaer expression, merge(other) combines the objects. On a shared field name, the other object’s value wins.

## Related

- [Use data transformation methods in Duaer](https://doc.duaer.com/code/builtin/data-transformation-functions.md)
- [Array transformation methods in Duaer](https://doc.duaer.com/code/builtin/data-transformation-functions/arrays.md)
- [Query JSON with JMESPath in Duaer](https://doc.duaer.com/code/cookbook/jmespath.md)

