-1

We are looking for a none() step alternative as our Gremlin compliant queries use a none() step but Cosmos throws a "'none' step not recognized error".

Since Cosmos supports String based queries while adding a Vertex in Java using the .iterate() method, on the Gremlin traversal a none() step gets added, which is not supported in Cosmos . Is there any alternative to the none() step? Can we use .toList() instead of .iterate() on the traversal?

Kelvin Lawrence
  • 14,674
  • 2
  • 16
  • 38

1 Answers1

0

The iterate terminal step just tells Gremlin to run the query but not return any results. Under the covers, this adds an implicit none step to the query. It should be fine to use any other terminal step that your particular backend implementation can handle. Using toList will iterate the traversal and also return any results generated by the query in a list. If there are no results, an empty list [] will be returned and your code should check for that case.

Kelvin Lawrence
  • 14,674
  • 2
  • 16
  • 38