---
name: "Catmandu::Fix::retain"
section: "3pm"
platform: "linux"
package: "libcatmandu-perl"
version: "1.2024-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Catmandu::Fix::retain"
---

# Catmandu::Fix::retain(3pm)

delete everything except the paths given

## NAME

Catmandu::Fix::retain - delete everything except the paths given

## SYNOPSIS

```
   # Keep the field _id , name , title
   retain(_id , name, title)
   # Delete everything except foo.bar
   #   {bar => { x => 1} , foo => {bar => 1, y => 2}}
   # to
   #   {foo => {bar => 1}}
   retain(foo.bar)
```

## SEE ALSO

Catmandu::Fix
