a) store the lowercased value of your String property as another property (slower writes, faster reads) orb) use a lambda to order by lowercased values (faster writes, slower reads):
.order().by {a, b -> b.value('property').toLowerCase().compareTo(a.value('property').toLowerCase()) }
--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/5970f918-59e5-4803-abd6-555131d34e5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
That's how Strings are supposed to get sorted. If you're looking for case-insensitive ordering, you shoulda) store the lowercased value of your String property as another property (slower writes, faster reads) orb) use a lambda to order by lowercased values (faster writes, slower reads):.order().by {a, b -> b.value('property').toLowerCase().compareTo(a.value('property').toLowerCase()) }Cheers,Daniel
On Wed, Jul 11, 2018 at 8:57 AM, Ismail Awan <ismailsh...@gmail.com> wrote:
While trying to sort using
order().by("property",decr) or
order().by("property",decr)
while property is a string
Uppercase 'Z' comes before lowercase 'a' or vice versa
Can anyone provide some help in this regard ??
--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/392cb65a-fe16-44de-9051-5c943bc66f53%40googlegroups.com.
descending order
order().by((a,b) -> b.value("property").toString().toLowerCase().compareTo(a.value("property").toString().toLowerCase()))
ascending order
order().by((a,b) -> a.value("property").toString().toLowerCase().compareTo(b.value("property").toString().toLowerCase()))