nushell/crates/nu-engine/src
Bahex 089c5221cc
Add new operators has and not-has (#14841)
# Description
This PR add 2 new operators, `has` and `not-has`. They are basically
`in` and `not-in` with the order of operands swapped.

Motivation for this was the awkward way of searching for rows that
contain an item using `where`

```nushell
[[name, children]; [foo, [a, b, c]], [bar [d, e, f]]]
| where ("e" in $it.children)
```
vs
```nushell
[[name, children]; [foo, [a, b, c]], [bar [d, e, f]]]
| where children has "e"
``` 

# User-Facing Changes
Added `has` and `not-has` operators, mirroring `in` and `not-in`.

# Tests + Formatting

- 🟢 toolkit fmt
- 🟢 toolkit clippy
- 🟢 toolkit test
- 🟢 toolkit test stdlib

# After Submitting
2025-01-17 06:20:00 -06:00
..
compile Run ENV_CONVERSIONS whenever it's modified (#14591) 2024-12-25 21:37:24 +08:00
call_ext.rs Remove duplicate implementations of CallExt::rest (#14484) 2024-12-01 15:03:45 +01:00
closure_eval.rs Make timeit take only closures as an argument (#14483) 2024-12-10 23:08:53 +08:00
column.rs Use Record's public API in a bunch of places (#10927) 2023-11-08 14:24:00 +01:00
command_prelude.rs Add --long flag for sys cpu (#14485) 2024-12-01 05:56:42 -06:00
documentation.rs finish removing terminal_size dep (#14819) 2025-01-13 07:00:21 -06:00
env.rs Convert Path to list in main and preserve case (#14764) 2025-01-10 10:18:44 -06:00
eval_helpers.rs Error on non-zero exit statuses (#13515) 2024-09-07 06:44:26 +00:00
eval_ir.rs Add new operators has and not-has (#14841) 2025-01-17 06:20:00 -06:00
eval.rs Add run-time type checking for command pipeline input (#14741) 2025-01-08 23:09:47 +01:00
glob_from.rs Handle permission denied error at nu_engine::glob_from (#14679) 2025-01-07 15:44:55 -06:00
lib.rs Add top-level crate documentation/READMEs (#12907) 2024-07-14 10:10:41 +02:00
scope.rs return const values from scope variables (#14577) 2024-12-13 16:23:17 -06:00