Skip to content

Commit d275fc5

Browse files
authored
(DOCSP-26069): Inaccuracy in document count for multi-document transactions (#2138)
* Inaccuracy in document count for multi-document transactions * copy review feedback * copy review feedback 2 * copy review feedback 3 * tech review feedback
1 parent 59e5617 commit d275fc5

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
When you use |countMethod| in a transaction, the resulting count will
2+
not filter out any uncommitted :ref:`multi-document transactions <transactions>`.

source/reference/command/count.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ option.
177177
Count and Transactions
178178
~~~~~~~~~~~~~~~~~~~~~~
179179

180-
You cannot use :dbcommand:`count` and shell helpers
181-
:method:`~cursor.count()` and :method:`db.collection.count()` in
182-
:ref:`transactions <transactions-ops-count>`.
180+
.. include:: /includes/fact-uncommitted-transactions.rst
181+
182+
.. |countMethod| replace:: :dbcommand:`count`
183183

184184
For details, see :ref:`Transactions and Count Operations
185185
<transactions-ops-count>`.

source/reference/method/db.collection.countDocuments.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ Transactions
148148

149149
.. include:: /includes/extracts/transactions-supported-operation.rst
150150

151+
.. include:: /includes/fact-uncommitted-transactions.rst
152+
153+
.. |countMethod| replace:: :method:`db.collection.countDocuments()`
154+
151155
.. include:: /includes/extracts/transactions-usage.rst
152156

153157
.. |operation| replace:: :method:`db.collection.countDocuments()`

source/reference/method/db.collection.estimatedDocumentCount.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ Client Disconnection
9696

9797
.. include:: /includes/extracts/4.2-changes-disconnect.rst
9898

99+
Count and Transactions
100+
~~~~~~~~~~~~~~~~~~~~~~
101+
102+
.. include:: /includes/fact-uncommitted-transactions.rst
103+
104+
.. |countMethod| replace:: :method:`db.collection.estimatedDocumentCount()`
99105

100106
Example
101107
-------

0 commit comments

Comments
 (0)