File tree Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -129,16 +129,15 @@ def update_document(options = {})
129
129
unless updates . empty?
130
130
coll = collection ( _root )
131
131
selector = atomic_selector
132
+
133
+ # TODO: DRIVERS-716: If a new "Bulk Write" API is introduced, it may
134
+ # become possible to handle the writes for conflicts in the following call.
132
135
coll . find ( selector ) . update_one ( positionally ( selector , updates ) , session : _session )
133
136
134
137
# The following code applies updates which would cause
135
138
# path conflicts in MongoDB, for example when changing attributes
136
139
# of foo.0.bars while adding another foo. Each conflicting update
137
140
# is applied using its own write.
138
- #
139
- # TODO: MONGOID-5026: reduce the number of writes performed by
140
- # more intelligently combining the writes such that there are
141
- # fewer conflicts.
142
141
conflicts . each_pair do |modifier , changes |
143
142
144
143
# Group the changes according to their root key which is
Original file line number Diff line number Diff line change 295
295
expect ( truck . crates [ 0 ] . toys [ 0 ] . name ) . to eq "Teddy bear"
296
296
expect ( truck . crates [ 1 ] . volume ) . to eq 0.8
297
297
expect ( truck . crates [ 1 ] . toys . size ) . to eq 0
298
-
299
- # TODO: MONGOID-5026: combine the updates so that there are
300
- # no conflicts.
301
- #expect(truck.atomic_updates[:conflicts]).to eq nil
302
-
303
298
expect { truck . save! } . not_to raise_error
304
299
305
300
_truck = Truck . find ( truck . id )
You can’t perform that action at this time.
0 commit comments