Method: Moped::Protocol::Delete#initialize

Defined in:
lib/moped/protocol/delete.rb

#initialize(database, collection, selector, options = {}) ⇒ Delete

Create a new delete command. The database and collection arguments are joined together to set the full_collection_name.

Examples:

Delete.new "moped", "users", { condition: true },
  flags: [:remove_first],
  request_id: 123

Options Hash (options):

  • :request_id (Number)

    the command’s request id

  • :flags (Array)

    the flags for insertion. Supported flags: :remove_first



71
72
73
74
75
76
77
78
79
# File 'lib/moped/protocol/delete.rb', line 71

def initialize(database, collection, selector, options = {})
  @database   = database
  @collection = collection

  @full_collection_name = "#{database}.#{collection}"
  @selector             = selector
  @request_id           = options[:request_id]
  @flags                = options[:flags]
end