Sha256: b1ca07d9413df18d1a214d25c1568ffa9062d3042018d98238a617b552616ab0
Contents?: true
Size: 721 Bytes
Versions: 7
Compression:
Stored size: 721 Bytes
Contents
# frozen_string_literal: true module ROM module Mongo module Commands # Update command # # Updates tuple in its relation with new attributes # # @abstract class Update < ROM::Commands::Update include ROM::Mongo::Commands::Helper adapter :mongo # Passes tuple to relation for updation # # @param attributes [Hash] # # @return [Array<Hash>] # # @api public def execute(attributes) document = process_with_schema(pk.merge(attributes)) return [document] if dataset.collection.update_one(pk, attributes).modified_count.eql?(1) [] end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems