Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1888 5265e3a5c -> 0f51a2913
Mentioned the change in `min()` and `max()` in the upgrade docs. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/0f51a291 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/0f51a291 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/0f51a291 Branch: refs/heads/TINKERPOP-1888 Commit: 0f51a29136f97fa654d50aadc2968f59c64329d0 Parents: 5265e3a Author: Daniel Kuppitz <[email protected]> Authored: Wed Apr 4 07:28:46 2018 -0700 Committer: Daniel Kuppitz <[email protected]> Committed: Wed Apr 4 07:28:46 2018 -0700 ---------------------------------------------------------------------- docs/src/upgrade/release-3.4.x.asciidoc | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0f51a291/docs/src/upgrade/release-3.4.x.asciidoc ---------------------------------------------------------------------- diff --git a/docs/src/upgrade/release-3.4.x.asciidoc b/docs/src/upgrade/release-3.4.x.asciidoc index 1916da8..73bee4a 100644 --- a/docs/src/upgrade/release-3.4.x.asciidoc +++ b/docs/src/upgrade/release-3.4.x.asciidoc @@ -29,6 +29,39 @@ Please see the link:https://github.com/apache/tinkerpop/blob/3.4.0/CHANGELOG.asc === Upgrading for Users +==== Improvements in `min()` and `max()` + +Previously `min()` and `max()` where only working for numeric values. This has been changed and these steps can now operate over any `Comparable` value. The common workaround was the combination +of `order().by()` and `limit()` as shown here: + +[source,groovy] +---- +gremlin> g.V().values('name').order().by().limit(1) // workaround for min() +==>josh +gremlin> g.V().values('name').order().by(decr).limit(1) // workaround for max() +==>vadas +---- + +Any attempt to use `min()` or `max()` on non-numeric values lead to an exception: + +[source,groovy] +---- +gremlin> g.V().values('name').min() +java.lang.String cannot be cast to java.lang.Number +Type ':help' or ':h' for help. +Display stack trace? [yN] +---- + +With the changes in this release these kind of queries became a lot easier: + +[source,groovy] +---- +gremlin> g.V().values('name').min() +==>josh +gremlin> g.V().values('name').max() +==>vadas +---- + ==== Modifications to reducing barrier steps The behavior of `min()`, `max()`, `mean()` and `sum()` has been modified to return no result if there's no input. Previously these steps yielded the internal seed value:
