Class: ROM::Mongo::Commands::Create

Inherits:
Commands::Create
  • Object
show all
Defined in:
lib/rom/mongo/commands.rb

Instance Method Summary collapse

Instance Method Details

#collectionObject



11
12
13
# File 'lib/rom/mongo/commands.rb', line 11

def collection
  relation.dataset
end

#execute(document) ⇒ Object



15
16
17
18
# File 'lib/rom/mongo/commands.rb', line 15

def execute(document)
  collection.insert(document)
  [document]
end