-
Notifications
You must be signed in to change notification settings - Fork 43
DOCSP-32154: collStats deprecation #431
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
Changes from all commits
55b2ff7
62de246
d333d3a
c439e48
9232ffc
5dbc168
daf2752
dd27de7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,29 @@ Learn what's new in: | |
Upcoming Breaking Changes | ||
------------------------- | ||
|
||
.. Relocate these items into the source/upgrade.txt page once they become breaking changes | ||
|
||
The following changes affect future versions of the driver: | ||
|
||
- The ``getStats()`` and ``isCapped()`` instance methods of the | ||
``DBCollection`` class are deprecated in v4.11. The corresponding server | ||
commands are deprecated in MongoDB v6.2 and later. Use the ``$collStats`` aggregation | ||
pipeline stage to retrieve the information provided by these methods | ||
instead. You can run the aggregation as shown in the following code example: | ||
|
||
.. code-block:: java | ||
|
||
collection.aggregate(Arrays.asList( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just checking whether you tested this, since I have not. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I tested it. I posted valid code from which I extracted this snippet in our Slack channel when asking whether there was a more idiomatic way to get that data. |
||
new Document("$collStats", | ||
new Document("storageStats", new Document())))); | ||
|
||
To determine whether the collection is a capped collection, access the value | ||
of the ``storageStats.capped`` field returned by this example aggregation. | ||
|
||
To learn more about the ``$collStats`` aggregation operator, see the | ||
:manual:`$collStats (aggregation) </reference/operator/aggregation/collStats/>` | ||
Server manual entry. | ||
|
||
- `MapReduceIterable <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MapReduceIterable.html>`__ | ||
and map-reduce methods on `MongoCollection <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#mapReduce(com.mongodb.client.ClientSession,java.lang.String,java.lang.String)>`__ | ||
are deprecated in MongoDB v4.2 and later. They will be replaced by the | ||
|
@@ -46,9 +69,11 @@ What's New in 4.11 | |
.. note:: Upgraded Netty Version | ||
|
||
The {+driver-short+} now tests with version 4.1.87.Final of the | ||
``io.netty:netty-all`` package. This change affects you only if you use the | ||
``io.netty:netty-all`` package. This change affects you only if you use the | ||
``SslContext`` class that Netty provides. | ||
|
||
.. New features of the 4.11 driver release include: | ||
|
||
.. _version-4.10: | ||
|
||
What's New in 4.10 | ||
|
@@ -81,9 +106,9 @@ What's New in 4.9 | |
----------------- | ||
|
||
.. important:: Aggregation Expression Operations Are in Beta | ||
|
||
This driver version introduces an API for creating | ||
:ref:`aggregation expressions <java-aggregation-expression-operations>`. | ||
:ref:`aggregation expressions <java-aggregation-expression-operations>`. | ||
This feature is in beta phase. | ||
|
||
New features of the 4.9 driver release include: | ||
|
Uh oh!
There was an error while loading. Please reload this page.