Sha256: cf7f53b66ccdd879e040289569f4f13a4916d2b9f15aa5ef332e17d00a85182a
Contents?: true
Size: 681 Bytes
Versions: 188
Compression:
Stored size: 681 Bytes
Contents
# encoding: utf-8 module Mongoid #:nodoc: module Persistence #:nodoc: module Atomic #:nodoc: # Performs atomic $unset operations. class Unset include Operation # Sends the atomic $unset operation to the database. # # @example Persist the new values. # unset.persist # # @return [ nil ] The new value. # # @since 2.1.0 def persist prepare do document.attributes.delete(field) collection.update(document.atomic_selector, operation("$unset"), options) document.remove_change(value) end end end end end end
Version data entries
188 entries across 96 versions & 4 rubygems