Skip to main content

strip_fields

Function strip_fields 

Source
pub fn strip_fields(doc: &mut Value, names: &[FieldName]) -> usize
Expand description

Removes each named field from the top-level object of doc, if present.

The inverse of inject_fields. Lenient by design: stripping a field that is absent (or a non-object body) is a no-op, because the read path must never fail just because a document predates a tenancy field.

Returns the number of fields actually removed (for a strip/inject symmetry assertion and observability).