1

I'm new to OrientDB. I would like to use the functionalities of OrientDB, however, my mind is a little bit confused with the usage of @rid function.

I have read the web documentation of the application and group discussions, and I am trying to figure out the concepts.

I apologise for any cross-posting about the issue. I couldn’t understand the usage of (@rid). In an online application, how do we understand and use the @rid value of a vertex or node?

Do we have to use all of them? How can we traverse without using @rid? How can we be sure about the 11:4 value in a framework that produces such kind of dynamic query?

select from 11:4 where any() traverse(0,10) (address.city = 'Rome')
halfer
  • 19,824
  • 17
  • 99
  • 186
Yilmazerhakan
  • 1,765
  • 1
  • 13
  • 21

1 Answers1

5

This is the Record ID (rid for short) of a OrientDB database. It uniquely identifies a record within the database. Some databases use a globally unique identifier (MongoDB) or a primary key (RDBMS). These are all similar concepts.

Because OrientDB is "several databases in one", record translates to

  • Document, if using the document database (API)
  • Vertex or Edge, if using the Graph database (API)
  • Object, if using the Object Database (API)

So in your example 11:4 means the fifth record (first record is 0) in cluster 11 (first cluster is also 0). This is a (almost) direct pointer to the physical record in the database. That becomes the starting point of your traversal. Key to understand is that you have very fast access to your data without using an index lookup.

rmuller
  • 12,062
  • 4
  • 64
  • 92