remove
Description
The remove
command deletes one or more keypaths from every document in the working set. It is the inverse of choose
, which keeps only the specified fields.
This is especially useful for sanitizing logs or removing fields containing unnecessary or sensitive information before performing analysis.
Note
remove
can operate on scalar values or entire objects.
Syntax
Example
Use case: Remove personal data from logs
Suppose your dataset includes user information, and you need to remove the email
field for privacy reasons before further processing.
Example data
Example query
Example output
The remove
command eliminates the email
keypath and its value from each document, leaving all other fields intact.
Theme
Light