0
votes

the syntax that i have so far is this:

g.V().has('@class', 'Person').order{it.a.last_name <=> it.b.last_name}[0..9]

but it seems like the closure provided to order is executed at the client, which implies the entire extent of the collection needs to move to the client for evaluation.

is this the case, and if so, what are my options for sorting and paging server side with orient-db (2.2+)?

1

1 Answers

1
votes

OrientDB database functions can't be executed in pure GREMLIN language, but you call write 1 line of JS or SQL that executes GREMLIN. Example of a database function with SQL as language:

select expand( gremlin( "g.V().has('@class', 'Person')
            .order{it.a. last_name <=> it.b. last_name}[0..9]" ) )

NOTE: This is working only with last develop version (2.2.1-SNAPSHOT).