Skip to content

Commit 31d5f11

Browse files
authored
RUBY-2996 add feature flag for update/replace (#2515)
* RUBY-2996 define feature flag * unpend tests * fix spacing * RUBY-2996 use the feature flag * RUBY-2996 move config override * RUBY-2996 asnwer comments * RUBY-2996 set feature flag * RUBY-2996 include warning * RUBY-2996 answer comments * RUBY-2996 throttle the warning * RUBY-2996 add user docs * RUBY-2996 fix test
1 parent 1596fa4 commit 31d5f11

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

source/reference/create-client.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2050,3 +2050,29 @@ driver in production:
20502050
<https://devcenter.heroku.com/articles/request-timeout>`_ is 30 seconds and
20512051
is not configurable; if deploying a Ruby application using MongoDB to Heroku,
20522052
consider lowering server selection timeout to 20 or 15 seconds.
2053+
2054+
Feature Flags
2055+
=============
2056+
2057+
The following is a list of feature flags that the Mongo Ruby Driver provides:
2058+
2059+
.. list-table::
2060+
:header-rows: 1
2061+
:widths: 30 60
2062+
2063+
* - Flag
2064+
- Description
2065+
* - ``validate_update_replace``
2066+
- Validates that there are no atomic operators (those that start with $)
2067+
in the root of a replacement document, and that there are only atomic
2068+
operators at the root of an update document. If this feature flag is on,
2069+
an error will be raised on an invalid update or replacement document,
2070+
if not, a warning will be output to the logs. (default: false)
2071+
2072+
These feature flags can be set directly on the ``Mongo`` module or using
2073+
the ``options`` method:
2074+
2075+
.. code::
2076+
2077+
Mongo.validate_update_replace = true
2078+
Mongo.options = { validate_update_replace: true }

0 commit comments

Comments
 (0)