(doc: &[u8], field: &str)
| 278 | |
| 279 | #[inline] |
| 280 | fn value_from_field(doc: &[u8], field: &str) -> Option<Value> { |
| 281 | let (start, end) = extract_field(doc, 0, field)?; |
| 282 | // Fast path: scalar types (null, bool, int, float, string). |
| 283 | if let Some(v) = crate::msgpack_scan::reader::read_value(doc, start) { |
| 284 | return Some(v); |
| 285 | } |
| 286 | // Slow path: complex types (array, map, bin) — decode field bytes directly. |
| 287 | let field_bytes = &doc[start..end]; |
| 288 | nodedb_types::json_msgpack::value_from_msgpack(field_bytes).ok() |
| 289 | } |
| 290 | |
| 291 | /// Find min or max across docs by comparing raw field bytes. |
| 292 | fn find_minmax( |
no test coverage detected