The four association queries

video locked
Enroll to watch

5 mins

Chapters
About
Discussion0
Notes
Be the first to start a conversation!

TAO offers four queries on a source and a type of association.

  1. Get. It returns the associations from the source to any destination in a set, between a start time and an end time.
  2. Count. It returns the count of all edges of the type from the source.
  3. Range. It takes a position and a limit, such as the first 50 after an offset of a hundred. This helps pagination.
  4. Time range. It takes a start time, an end time and a limit, such as the top 10 posts Gaurav has liked in the last three days.

The 50 most recent comments on a post is a time range. The likes on a post are a count.

A check-in can be stored in two ways. In the first, Gaurav has an edge to a check-in object, which has an edge to Taj. It is more flexible, but a query goes through two edges. In the second, each check-in object holds the place, so a count of places in the last three days is one query.