@@ -362,6 +362,42 @@ Example Mongoid 7.1 behavior:
362
362
Mongoid provides :ref:`sharding management Rake tasks <sharding-management>`
363
363
to shard collections according to shard keys declared in models.
364
364
365
+ Query Cache Moved to Driver
366
+ ---------------------------
367
+
368
+ Minor change: Ruby driver version 2.14.0 implements a new and improved query
369
+ cache. When using driver version 2.14.0 or newer, Mongoid will use the driver's
370
+ query cache to cache query results.
371
+
372
+ The driver query cache introduces the following improvements:
373
+
374
+ * Caching multi-batch query results
375
+ * Taking a query's read concern and read preference into account when deciding
376
+ when to return cached results
377
+ * Invalidating the cache after bulk write operations and aggregation operations
378
+ with ``$out`` and ``$merge`` pipeline stages
379
+ * Invalidating the cache after transaction commit and abort operations
380
+ * Improved performance of queries with limits
381
+ * Caching aggregation results
382
+ * More efficient query cache invalidation
383
+
384
+ Mongoid's query cache, which will now be referred to as the "legacy query cache,"
385
+ has been deprecated. Mongoid will retain the legacy query cache for use with
386
+ older versions of the driver.
387
+
388
+ The interface for enabling and disabling the query cache in Mongoid has not
389
+ changed. When using driver versions 2.14.0 and newer, this interface will
390
+ enable or disable the query cache in the driver.
391
+
392
+ The driver query cache is more correct and more effective than the legacy
393
+ Mongoid query cache. If you plan to use the query cache, it is recommended
394
+ that you upgrade to driver version 2.14.
395
+
396
+ To read more about the query cache improvements made in the driver, see
397
+ `the Ruby driver documentation <https://docs.mongodb.com/ruby-driver/current/tutorials/query-cache/>`_.
398
+
399
+ To read more about using the query cache with Mongoid and the limitations
400
+ of the legacy query cache, see :ref:`the query cache documentation <query-cache>`.
365
401
366
402
Upgrading to Mongoid 7.1
367
403
========================
0 commit comments