Mosql.ChangeStreamEvent (mosql v0.1.0)

Represents change stream event in a simpler format needed for MOSQL

Link to this section Summary

Types

t()

ChangeStream type definition

Functions

Process the change event document from the Mongo change stream. Change event spec (https://www.mongodb.com/docs/manual/reference/change-events/): { _id : { <BSON Object> }, "operationType" : "<operation>", "fullDocument" : { <document> }, "ns" : { "db" : "<database>", "coll" : "<collection>" }, "to" : { "db" : "<database>", "coll" : "<collection>" }, "documentKey" : { "_id" : <value> }, "updateDescription" : { "updatedFields" : { <document> }, "removedFields" : [ "<field>", ... ], "truncatedArrays" : [ { "field" : <field>, "newSize" : <integer> }, ... ] }, "clusterTime" : <Timestamp>, "txnNumber" : <NumberLong>, "lsid" : { "id" : <UUID>, "uid" : <BinData> } }

Link to this section Types

@type t() :: %Mosql.ChangeStreamEvent{
  coll: String.t(),
  db: String.t(),
  document: term(),
  id: String.t(),
  operation_type: String.t(),
  raw_event_data: term()
}

ChangeStream type definition

Link to this section Functions

Link to this function

parse_message(change_event)

Process the change event document from the Mongo change stream. Change event spec (https://www.mongodb.com/docs/manual/reference/change-events/): { _id : { <BSON Object> }, "operationType" : "<operation>", "fullDocument" : { <document> }, "ns" : { "db" : "<database>", "coll" : "<collection>" }, "to" : { "db" : "<database>", "coll" : "<collection>" }, "documentKey" : { "_id" : <value> }, "updateDescription" : { "updatedFields" : { <document> }, "removedFields" : [ "<field>", ... ], "truncatedArrays" : [ { "field" : <field>, "newSize" : <integer> }, ... ] }, "clusterTime" : <Timestamp>, "txnNumber" : <NumberLong>, "lsid" : { "id" : <UUID>, "uid" : <BinData> } }