Skip to content

Commit

Permalink
clarified some info about CIDs in the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mackuba committed Jun 3, 2023
1 parent b77a2cd commit 782c3b9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ Each message passed to `on_message` is an instance of the `WebsocketMessage` cla
- `seq` (sequential number)
- `time` (Time)
- `repo` (string) - DID of the repository (user account)
- `commit` - CID
- `commit` - CID of the commit
- `prev` - CID of the previous commit in that repo
- `operations` - list of operations (usually one)

Operations are objects of type `Operation` and have such properties:
Expand All @@ -63,9 +64,9 @@ Operations are objects of type `Operation` and have such properties:
- `action` (symbol) - `:create`, `:update` or `:delete`
- `uri` (string) - the at:// URI
- `type` (symbol) - short name of the collection, e.g. `:bsky_post`
- `cid` - CID
- `cid` - CID of the operation/record (`nil` for delete operations)

Most operations will also have an attached record (JSON object) with details of the post, like etc. The record data is currently available as a Ruby hash via `raw_record` property (custom types will be added in a later version).
Create and update operations will also have an attached record (JSON object) with details of the post, like etc. The record data is currently available as a Ruby hash via `raw_record` property (custom types will be added in a later version).

So for example, in order to filter only "create post" operations and print their details, you can do something like this:

Expand Down

0 comments on commit 782c3b9

Please sign in to comment.