Add a unique function.

This commit is contained in:
Stephen Dolan committed 2012-12-03 02:02:12 +00:00
1 parent c8bbfed041
commit fadeb66365
3 files changed
+17

No files matched your search

+1
View File
@@ -295,6 +295,7 @@ static const char* jq_builtins[] = {
"def select(f): if f then . else empty end;",
"def sort_by(f): _sort_by_impl(map([f]));",
"def group_by(f): _group_by_impl(map([f]));",
"def unique: group_by(.) | map(.[0]);",
};