struct

Mongo::ChangeStream::Document::UpdateDescription

Inherits BSON::Serializable / Struct / Value / Object

Constructors

new(bson : BSON)

Allocate an instance and copies data from a BSON struct.

class User
  include BSON::Serializable
  property name : String
end

data = BSON.new
data["name"] = "John"
User.new(data)
Source

Class methods

from_bson(bson : BSON)

NOTE: See self.new.

Source

Instance methods

removed_fields

An array of field names that were removed from the document.

Source
to_bson(bson = BSON.new)

Converts to a BSON representation.

user = User.new name: "John"
bson = user.to_bson
Source
updated_fields

A document containing key:value pairs of names of the fields that were changed, and the new value for those fields.

Source