Skip to content

remove - Remove unwanted keypaths

The remove operator will take a set of keypaths out of every document in the working set.

This is the negation of choose.

NOTE: remove works on scalar values or objects.

Syntax

r|remove <keypath1> [ "," <keypath2> ]...

Example - Removing personal information from data

Consider the following document:

{
    "username": "chris",
    "email": "[email protected]",
    "location": "UK",
    "domain": "chris.com"
}

There are several fields in this document we want to keep, but email is personal, so we want to remove it without touching the others. We can do this using the remove operator:

remove email