Skip to main content

project_doc

Function project_doc 

Source
pub fn project_doc(doc: &Value, select: &[String]) -> Value
Expand description

Restrict a document to the selected top-level fields.

id is always retained: it is injected by the adapter rather than stored, and every caller keys results by it, so a projection that dropped it would return documents nothing could address.

Only top-level fields are addressable, matching the same restriction sorting and filtering already carry. A non-object value is returned untouched.