diff --git a/docs/src/manpage.md b/docs/src/manpage.md index 0bab49596..0c41c8b2f 100644 --- a/docs/src/manpage.md +++ b/docs/src/manpage.md @@ -239,8 +239,8 @@ This is simply a copy of what you should see on running `man mlr` at a command p capitalize cbrt ceil clean_whitespace collapse_whitespace concat contains cos cosh count depth dhms2fsec dhms2sec distinct_count erf erfc every exec exp expm1 flatten float floor fmtifnum fmtnum fold format fsec2dhms fsec2hms - get_keys get_values gmt2localtime gmt2nsec gmt2sec gssub gsub haskey hexfmt - hms2fsec hms2sec hostname index int invqnorm is_absent is_array is_bool + get_keys get_values gmt2localtime gmt2nsec gmt2sec gssub gsub haskey hasvalue + hexfmt hms2fsec hms2sec hostname index int invqnorm is_absent is_array is_bool is_boolean is_empty is_empty_map is_error is_float is_int is_map is_nan is_nonempty_map is_not_array is_not_empty is_not_map is_not_null is_null is_numeric is_present is_string joink joinkv joinv json_parse json_stringify @@ -2584,6 +2584,9 @@ This is simply a copy of what you should see on running `man mlr` at a command p 1mhaskey0m (class=collections #args=2) True/false if map has/hasn't key, e.g. 'haskey($*, "a")' or 'haskey(mymap, mykey)', or true/false if array index is in bounds / out of bounds. Error if 1st argument is not a map or array. Note -n..-1 alias to 1..n in Miller arrays. + 1mhasvalue0m + (class=collections #args=2) True/false if map/array has/hasn't value, e.g. 'hasvalue($*, "a")' or 'hasvalue(myarray, myvalue)', returns true if the value is present in the collection. Error if 1st argument is not a map or array. + 1mhexfmt0m (class=conversion #args=1) Convert int to hex string, e.g. 255 to "0xff". @@ -3820,5 +3823,5 @@ This is simply a copy of what you should see on running `man mlr` at a command p MIME Type for Comma-Separated Values (CSV) Files, the Miller docsite https://miller.readthedocs.io - 2026-03-16 4mMILLER24m(1) + 2026-04-08 4mMILLER24m(1) diff --git a/docs/src/manpage.txt b/docs/src/manpage.txt index 135813970..ae9d9c087 100644 --- a/docs/src/manpage.txt +++ b/docs/src/manpage.txt @@ -218,8 +218,8 @@ capitalize cbrt ceil clean_whitespace collapse_whitespace concat contains cos cosh count depth dhms2fsec dhms2sec distinct_count erf erfc every exec exp expm1 flatten float floor fmtifnum fmtnum fold format fsec2dhms fsec2hms - get_keys get_values gmt2localtime gmt2nsec gmt2sec gssub gsub haskey hexfmt - hms2fsec hms2sec hostname index int invqnorm is_absent is_array is_bool + get_keys get_values gmt2localtime gmt2nsec gmt2sec gssub gsub haskey hasvalue + hexfmt hms2fsec hms2sec hostname index int invqnorm is_absent is_array is_bool is_boolean is_empty is_empty_map is_error is_float is_int is_map is_nan is_nonempty_map is_not_array is_not_empty is_not_map is_not_null is_null is_numeric is_present is_string joink joinkv joinv json_parse json_stringify @@ -2563,6 +2563,9 @@ 1mhaskey0m (class=collections #args=2) True/false if map has/hasn't key, e.g. 'haskey($*, "a")' or 'haskey(mymap, mykey)', or true/false if array index is in bounds / out of bounds. Error if 1st argument is not a map or array. Note -n..-1 alias to 1..n in Miller arrays. + 1mhasvalue0m + (class=collections #args=2) True/false if map/array has/hasn't value, e.g. 'hasvalue($*, "a")' or 'hasvalue(myarray, myvalue)', returns true if the value is present in the collection. Error if 1st argument is not a map or array. + 1mhexfmt0m (class=conversion #args=1) Convert int to hex string, e.g. 255 to "0xff". @@ -3799,4 +3802,4 @@ MIME Type for Comma-Separated Values (CSV) Files, the Miller docsite https://miller.readthedocs.io - 2026-03-16 4mMILLER24m(1) + 2026-04-08 4mMILLER24m(1) diff --git a/docs/src/reference-dsl-builtin-functions.md b/docs/src/reference-dsl-builtin-functions.md index 97fc182f6..1b3b1af40 100644 --- a/docs/src/reference-dsl-builtin-functions.md +++ b/docs/src/reference-dsl-builtin-functions.md @@ -54,7 +54,7 @@ Operators are listed here along with functions. In this case, the argument count * [**Arithmetic functions**](#arithmetic-functions): [bitcount](#bitcount), [madd](#madd), [mexp](#mexp), [mmul](#mmul), [msub](#msub), [pow](#pow), [%](#percent), [&](#bitwise-and), [\*](#times), [\**](#exponentiation), [\+](#plus), [\-](#minus), [\.\*](#dot-times), [\.\+](#dot-plus), [\.\-](#dot-minus), [\./](#dot-slash), [/](#slash), [//](#slash-slash), [<<](#lsh), [>>](#srsh), [>>>](#ursh), [^](#bitwise-xor), [\|](#bitwise-or), [~](#bitwise-not). * [**Boolean functions**](#boolean-functions): [\!](#exclamation-point), [\!=](#exclamation-point-equals), [!=~](#regnotmatch), [&&](#logical-and), [<](#less-than), [<=](#less-than-or-equals), [<=>](#<=>), [==](#double-equals), [=~](#regmatch), [>](#greater-than), [>=](#greater-than-or-equals), [?:](#question-mark-colon), [??](#absent-coalesce), [???](#absent-empty-coalesce), [^^](#logical-xor), [\|\|](#logical-or). -* [**Collections functions**](#collections-functions): [append](#append), [arrayify](#arrayify), [concat](#concat), [depth](#depth), [flatten](#flatten), [get_keys](#get_keys), [get_values](#get_values), [haskey](#haskey), [json_parse](#json_parse), [json_stringify](#json_stringify), [leafcount](#leafcount), [length](#length), [mapdiff](#mapdiff), [mapexcept](#mapexcept), [mapselect](#mapselect), [mapsum](#mapsum), [unflatten](#unflatten). +* [**Collections functions**](#collections-functions): [append](#append), [arrayify](#arrayify), [concat](#concat), [depth](#depth), [flatten](#flatten), [get_keys](#get_keys), [get_values](#get_values), [haskey](#haskey), [hasvalue](#hasvalue), [json_parse](#json_parse), [json_stringify](#json_stringify), [leafcount](#leafcount), [length](#length), [mapdiff](#mapdiff), [mapexcept](#mapexcept), [mapselect](#mapselect), [mapsum](#mapsum), [unflatten](#unflatten). * [**Conversion functions**](#conversion-functions): [boolean](#boolean), [float](#float), [fmtifnum](#fmtifnum), [fmtnum](#fmtnum), [hexfmt](#hexfmt), [int](#int), [joink](#joink), [joinkv](#joinkv), [joinv](#joinv), [splita](#splita), [splitax](#splitax), [splitkv](#splitkv), [splitkvx](#splitkvx), [splitnv](#splitnv), [splitnvx](#splitnvx), [string](#string). * [**Hashing functions**](#hashing-functions): [md5](#md5), [sha1](#sha1), [sha256](#sha256), [sha512](#sha512). * [**Higher-order-functions functions**](#higher-order-functions-functions): [any](#any), [apply](#apply), [every](#every), [fold](#fold), [reduce](#reduce), [select](#select), [sort](#sort). @@ -437,6 +437,12 @@ haskey (class=collections #args=2) True/false if map has/hasn't key, e.g. 'hask +### hasvalue +
+hasvalue  (class=collections #args=2) True/false if map/array has/hasn't value, e.g. 'hasvalue($*, "a")' or 'hasvalue(myarray, myvalue)', returns true if the value is present in the collection. Error if 1st argument is not a map or array.
+
+ + ### json_parse
 json_parse  (class=collections #args=1) Converts value from JSON-formatted string.
diff --git a/man/manpage.txt b/man/manpage.txt
index 135813970..ae9d9c087 100644
--- a/man/manpage.txt
+++ b/man/manpage.txt
@@ -218,8 +218,8 @@
        capitalize cbrt ceil clean_whitespace collapse_whitespace concat contains cos
        cosh count depth dhms2fsec dhms2sec distinct_count erf erfc every exec exp
        expm1 flatten float floor fmtifnum fmtnum fold format fsec2dhms fsec2hms
-       get_keys get_values gmt2localtime gmt2nsec gmt2sec gssub gsub haskey hexfmt
-       hms2fsec hms2sec hostname index int invqnorm is_absent is_array is_bool
+       get_keys get_values gmt2localtime gmt2nsec gmt2sec gssub gsub haskey hasvalue
+       hexfmt hms2fsec hms2sec hostname index int invqnorm is_absent is_array is_bool
        is_boolean is_empty is_empty_map is_error is_float is_int is_map is_nan
        is_nonempty_map is_not_array is_not_empty is_not_map is_not_null is_null
        is_numeric is_present is_string joink joinkv joinv json_parse json_stringify
@@ -2563,6 +2563,9 @@
    1mhaskey0m
         (class=collections #args=2) True/false if map has/hasn't key, e.g. 'haskey($*, "a")' or 'haskey(mymap, mykey)', or true/false if array index is in bounds / out of bounds. Error if 1st argument is not a map or array. Note -n..-1 alias to 1..n in Miller arrays.
 
+   1mhasvalue0m
+        (class=collections #args=2) True/false if map/array has/hasn't value, e.g. 'hasvalue($*, "a")' or 'hasvalue(myarray, myvalue)', returns true if the value is present in the collection. Error if 1st argument is not a map or array.
+
    1mhexfmt0m
         (class=conversion #args=1) Convert int to hex string, e.g. 255 to "0xff".
 
@@ -3799,4 +3802,4 @@
        MIME Type for Comma-Separated Values (CSV) Files, the Miller docsite
        https://miller.readthedocs.io
 
-                                  2026-03-16                         4mMILLER24m(1)
+                                  2026-04-08                         4mMILLER24m(1)
diff --git a/man/mlr.1 b/man/mlr.1
index 79097c8db..a4b8980ec 100644
--- a/man/mlr.1
+++ b/man/mlr.1
@@ -2,12 +2,12 @@
 .\"     Title: mlr
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: ./mkman.rb
-.\"      Date: 2026-03-16
+.\"      Date: 2026-04-08
 .\"    Manual: \ \&
 .\"    Source: \ \&
 .\"  Language: English
 .\"
-.TH "MILLER" "1" "2026-03-16" "\ \&" "\ \&"
+.TH "MILLER" "1" "2026-04-08" "\ \&" "\ \&"
 .\" -----------------------------------------------------------------
 .\" * Portability definitions
 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -267,8 +267,8 @@ asserting_present asserting_string atan atan2 atanh bitcount boolean
 capitalize cbrt ceil clean_whitespace collapse_whitespace concat contains cos
 cosh count depth dhms2fsec dhms2sec distinct_count erf erfc every exec exp
 expm1 flatten float floor fmtifnum fmtnum fold format fsec2dhms fsec2hms
-get_keys get_values gmt2localtime gmt2nsec gmt2sec gssub gsub haskey hexfmt
-hms2fsec hms2sec hostname index int invqnorm is_absent is_array is_bool
+get_keys get_values gmt2localtime gmt2nsec gmt2sec gssub gsub haskey hasvalue
+hexfmt hms2fsec hms2sec hostname index int invqnorm is_absent is_array is_bool
 is_boolean is_empty is_empty_map is_error is_float is_int is_map is_nan
 is_nonempty_map is_not_array is_not_empty is_not_map is_not_null is_null
 is_numeric is_present is_string joink joinkv joinv json_parse json_stringify
@@ -3594,6 +3594,15 @@ gsub("prefix4529:suffix8567", "(....ix)([0-9]+)", "[\e1 : \e2]") gives "[prefix
 .fi
 .if n \{\
 .RE
+.SS "hasvalue"
+.if n \{\
+.RS 0
+.\}
+.nf
+ (class=collections #args=2) True/false if map/array has/hasn't value, e.g. 'hasvalue($*, "a")' or 'hasvalue(myarray, myvalue)', returns true if the value is present in the collection. Error if 1st argument is not a map or array.
+.fi
+.if n \{\
+.RE
 .SS "hexfmt"
 .if n \{\
 .RS 0