Skip to content

Rebase comp-cov for monorepo migration #170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions config/redirects
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ raw: ${prefix}/stable -> ${base}/current/
# General redirects
[v2.20-*]: ${prefix}/${version}/whats-new/ -> ${base}/${version}/reference/release-notes/
[v2.20-*]: ${prefix}/${version}/compatibility/ -> ${base}/${version}/reference/compatibility/
[v2.20-*]: ${prefix}/${version}/getting-started/ -> ${base}/${version}/get-started/

# redirects for 2.15

Expand Down Expand Up @@ -124,3 +125,34 @@ raw: ${prefix}/stable -> ${base}/current/
(v2.20-*]: ${prefix}/${version}/reference/search-indexes/ -> ${base}/${version}/indexes/atlas-search-index/
(v2.20-*]: ${prefix}/${version}/reference/collations/ -> ${base}/${version}/read/collations/
(v2.20-*]: ${prefix}/${version}/contribute/ -> ${base}/${version}/issues-and-help/

# Comprehensive coverage TOC shift

(*-master) ${prefix}/${version}/get-started/download-and-install/ -> ${base}/${version}/get-started/
(*-master) ${prefix}/${version}/get-started/create-a-deployment/ -> ${base}/${version}/get-started/
(*-master) ${prefix}/${version}/get-started/create-a-connection-string/ -> ${base}/${version}/get-started/
(*-master) ${prefix}/${version}/get-started/connect-to-mongodb/ -> ${base}/${version}/get-started/
(*-master) ${prefix}/${version}/get-started/next-steps/ -> ${base}/${version}/get-started/
(*-master) ${prefix}/${version}/databases-collections/ -> ${base}/${version}/get-started/
(*-master) ${prefix}/${version}/write/insert/ -> ${base}/${version}/crud/insert/
(*-master) ${prefix}/${version}/read/retrieve/ -> ${base}/${version}/crud/query/
(*-master) ${prefix}/${version}/write/update/ -> ${base}/${version}/crud/update/
(*-master) ${prefix}/${version}/write/replace/ -> ${base}/${version}/crud/replace/
(*-master) ${prefix}/${version}/write/delete/ -> ${base}/${version}/crud/delete/
(*-master) ${prefix}/${version}/write/bulk-write/ -> ${base}/${version}/crud/bulk-write/
(*-master) ${prefix}/${version}/write/transactions/ -> ${base}/${version}/crud/transactions/
(*-master) ${prefix}/${version}/read-write-pref/ -> ${base}/${version}/crud/configure-crud/
(*-master) ${prefix}/${version}/read/collations/ -> ${base}/${version}/crud/collations/
(*-master) ${prefix}/${version}/write/gridfs/ -> ${base}/${version}/crud/gridfs/
(*-master) ${prefix}/${version}/read/count/ -> ${base}/${version}/crud/query/count
(*-master) ${prefix}/${version}/read/retrieve/ -> ${base}/${version}/crud/query/find
(*-master) ${prefix}/${version}/read/project/ -> ${base}/${version}/crud/query/project
(*-master) ${prefix}/${version}/read/specify-documents-to-return/ -> ${base}/${version}/crud/query/specify-documents-to-return
(*-master) ${prefix}/${version}/read/distinct/ -> ${base}/${version}/crud/query/distinct
(*-master) ${prefix}/${version}/read/cursors/ -> ${base}/${version}/crud/query/cursors
(*-master) ${prefix}/${version}/read/specify-a-query/ -> ${base}/${version}/crud/query/specify-a-query
(*-master) ${prefix}/${version}/databases-collections/run-command -> ${base}/${version}/run-command
(*-master) ${prefix}/${version}/monitoring/cluster-monitoring -> ${base}/${version}/logging-and-monitoring/cluster-monitoring
(*-master) ${prefix}/${version}/read/change-streams/ -> ${base}/${version}/logging-and-monitoring/change-streams
(*-master) ${prefix}/${version}/connect/tls/ -> ${base}/${version}/security/tls
(*-master) ${prefix}/${version}/common-errors/ -> ${base}/${version}/
10 changes: 4 additions & 6 deletions snooty.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
name = "ruby-driver"
title = "Ruby Driver"
toc_landing_pages = [
"/get-started",
"/read",
"/write",
"/connect/connection-options",
"/crud/query",
"/indexes",
"/databases-collection",
"/security/authentication",
"/security/authentication"
]

intersphinx = ["https://www.mongodb.com/docs/manual/objects.inv"]
Expand All @@ -23,7 +21,7 @@ mongo-enterprise = "MongoDB Enterprise Edition"
docs-branch = "master"
# always set this to the driver branch (i.e. 1.7 1.8, etc.)
version-number = "2.21"
patch-version-number = "{+version-number+}.1"
patch-version-number = "{+version-number+}.2"
version = "v{+version-number+}"
stable-api = "Stable API"
api-root = "https://www.mongodb.com/docs/ruby-driver/current/api/"
Expand Down
5 changes: 5 additions & 0 deletions source/atlas-search.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.. _ruby-atlas-search

============
Atlas Search
============
3 changes: 0 additions & 3 deletions source/connect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ Connect to MongoDB
:maxdepth: 1

Create a Client </connect/mongoclient>
Stable API </connect/stable-api>
Choose a Connection Target </connect/connection-targets>
Connection Options </connect/connection-options>
Configure TLS </connect/tls>
Limit Server Execution Time </connect/csot>
AWS Lambda <https://www.mongodb.com/docs/atlas/manage-connections-aws-lambda/>
20 changes: 18 additions & 2 deletions source/connect/connection-options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ Specify Connection Options
.. meta::
:keywords: connection string, URI, server, Atlas, settings, configure

.. toctree::
:titlesonly:
:maxdepth: 1

Compress Network Traffic </connect/network-compression>
Stable API </connect/stable-api>
Limit Server Execution Time </connect/csot>

Overview
--------

Expand All @@ -38,8 +46,8 @@ and the ``tls`` option with a value of ``true``:
uri = "mongodb://<hostname>:<port>/?connectTimeoutMS=60000&tls=true"
client = Mongo::Client.new(uri)

Using a ``Mongo::Client``
~~~~~~~~~~~~~~~~~~~~~~~~~
Using a Mongo::Client
~~~~~~~~~~~~~~~~~~~~~

You can pass connection options as arguments to the ``Mongo::Client`` constructor
instead of including them in your connection URI.
Expand Down Expand Up @@ -142,6 +150,14 @@ Server Selection
* - Connection Option
- Description

* - **:load_balanced**
- | Whether to expect to connect to a load balancer.
|
| **Data Type**: ``Boolean``
| **Default**: ``false``
| **Client Example**: ``load_balanced: { true }``
| **Connection URI Example**: N/A

* - **:server_selector**
- | Get the server selector. It either uses the read preference
defined in the client options or defaults to a Primary
Expand Down
59 changes: 59 additions & 0 deletions source/connect/network-compression.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
========================
Compress Network Traffic
========================

.. meta::
:keywords: network compression, zlib, snappy, zstd, Ruby driver, connection string, URI, settings, configure

.. contents:: On this page
:local:
:depth: 2

Overview
--------

The {+driver-short+} supports network compression to reduce the amount
of data transmitted between the client and the server.

The driver supports the following compression algorithms:

- `Snappy <https://google.github.io/snappy/>`__
- `Zlib <https://zlib.net/>`__
- `Zstandard <https://github.com/facebook/zstd/>`__


If you specify multiple compression algorithms, the driver selects the first
one in the list supported by your MongoDB instance.

Specify Compression Algorithms
------------------------------

To enable compression for the connection to your MongoDB instance,
specify the algorithms you want to use in one of the following ways:

- Add the algorithms to your connection string as a parameter
- Specify the algorithms in the ``compressors`` option of your ``Mongo::Client`` object

.. tabs::

.. tab:: Connection String
:tabid: connection-string

To enable network compression by using the connection string, add the ``compressors`` option.
You can specify one or more algorithms as a comma-separated list.

.. literalinclude:: /includes/connect/network-compression.rb
:start-after: start-connection-string
:end-before: end-connection-string
:language: ruby

.. tab:: Client Settings
:tabid: client-settings

To enable compression in your Client object, pass the ``compressors`` option
to the ``Mongo::Client`` constructor.

.. literalinclude:: /includes/connect/network-compression.rb
:start-after: start-client-settings
:end-before: end-client-settings
:language: ruby
20 changes: 20 additions & 0 deletions source/crud.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
===============
CRUD Operations
===============

.. toctree::
:titlesonly:
:maxdepth: 1

Insert Documents </crud/insert>
Query Documents </crud/query>
Update Documents </crud/update>
Replace Documents </crud/replace>
Delete Documents </crud/delete>
Bulk Write Operations </crud/bulk-write>
Transactions </crud/transactions>
Configure CRUD Operations </crud/configure-crud>
Retryable Reads </crud/retryable-reads>
Retryable Writes </crud/retryable-writes>
Collation </crud/collations>
Store Large Files </crud/gridfs>
File renamed without changes.
2 changes: 1 addition & 1 deletion source/read/collations.txt → source/crud/collations.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _ruby-collations:

==========
Collations
Collation
==========

.. default-domain:: mongodb
Expand Down
6 changes: 3 additions & 3 deletions source/read-write-pref.txt → source/crud/configure-crud.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.. _ruby-crud-write-read-pref:

===============================
CRUD Operations on Replica Sets
===============================
=========================
Configure CRUD Operations
=========================

.. facet::
:name: genre
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 17 additions & 5 deletions source/read.txt → source/crud/query.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.. _ruby-read:

======================
Read Data from MongoDB
======================
===============
Query Documents
===============

.. contents:: On this page
:local:
Expand All @@ -23,15 +23,27 @@ Read Data from MongoDB
:maxdepth: 1

Retrieve Data </read/retrieve>
Specify a Query </read/specify-a-query>
Specify Documents to Return </read/specify-documents-to-return>
Specify Fields to Return </read/project>
Distinct Field Values </read/distinct>
Count Documents </read/count>
Cursors </read/cursors>
Access Data From a Cursor </read/cursors>
Monitor Changes </read/change-streams>
Collations </read/collations>


.. toctree::
:titlesonly:
:maxdepth: 1

Find Documents </crud/query/find>
Specify a Query </read/specify-a-query>
Specify Documents to Return </crud/query/project/specify-documents-to-return>
Specify Fields to Return </crud/query/project>
Count Documents </crud/query/count>
Distinct Field Values </crud/query/distinct>
Access Data from a Cursor </crud/query/cursors>

Overview
--------

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions source/read/retrieve.txt → source/crud/query/find.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.. _ruby-retrieve:

=============
Retrieve Data
=============
==============
Find Documents
==============

.. contents:: On this page
:local:
Expand All @@ -15,7 +15,7 @@ Retrieve Data
:values: reference

.. meta::
:keywords: code examples, read, query, cursor
:keywords: code examples, read, query, cursor, find

Overview
--------
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions source/crud/retryable-reads.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.. _ruby-crud-retryable-reads:

===============
Retryable Reads
===============

.. facet::
:name: genre
:values: reference

.. meta::
:keywords: timeout

.. contents:: On this page
:local:
:backlinks: none
:depth: 2
:class: singlecol
18 changes: 18 additions & 0 deletions source/crud/retryable-writes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.. _ruby-crud-retryable-writes:

================
Retryable Writes
================

.. facet::
:name: genre
:values: reference

.. meta::
:keywords: timeout

.. contents:: On this page
:local:
:backlinks: none
:depth: 2
:class: singlecol
29 changes: 29 additions & 0 deletions source/write/transactions.txt → source/crud/transactions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,35 @@ within the session.
created it. Using a session with a different ``Mongo::Client`` results in
operation errors.

Causal Consistency
~~~~~~~~~~~~~~~~~~

.. sharedinclude:: dbx/causal-consistency.rst

.. replacement:: insert-one-method

``insert_one()``

.. replacement:: update-one-method

``update_one()``

.. replacement:: find-one-method

``find()``

.. replacement:: delete-one-method

``delete_one()``

.. replacement:: majority-rc

``:majority``

.. replacement:: majority-wc

``:majority``

Methods
-------

Expand Down
Loading
Loading