Docs / EventSourcingDB / Errors / order-unknown

order-unknown

The order of a read is neither chronological nor antichronological.

  • Route: read-events
  • Description: order is unknown: expected 'chronological' or 'antichronological'
  • Details: value, the order as the request gave it.

Why It Happens#

The option order of a read takes exactly two values: chronological, which reads the oldest event first, and antichronological, which reads the newest event first. The values are case-sensitive, so Chronological is refused, and so are an empty string and words from other APIs, such as asc, desc, or reverse.

Leaving out order is fine, and reads chronologically. Observing events has no order, so observe-events does not know the option at all, and refuses it with 400 Bad Request as an unknown field.

How to Fix It#

Send order as chronological or antichronological, in lowercase, or leave it out to read chronologically. Sending the same request again fails the same way, since the outcome depends on the request alone.

Example#

To read the events of /books/42 with the order descending, EventSourcingDB answers with this error, as a line of the stream, and then ends the stream with its end item:

{
  "type": "error",
  "data": {
    "code": "https://docs.eventsourcingdb.io/errors/order-unknown",
    "description": "order is unknown: expected 'chronological' or 'antichronological'",
    "details": {
      "value": "descending"
    }
  }
}