Method: Mongo::Utils.transform_server_api
- Defined in:
- lib/mongo/utils.rb
.transform_server_api(server_api) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Note:
server_api must have symbol keys or be a BSON::Document.
77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/mongo/utils.rb', line 77 module_function def transform_server_api(server_api) {}.tap do |doc| if version = server_api[:version] doc['apiVersion'] = version end unless server_api[:strict].nil? doc['apiStrict'] = server_api[:strict] end unless server_api[:deprecation_errors].nil? doc['apiDeprecationErrors'] = server_api[:deprecation_errors] end end end |