@@ -241,9 +241,9 @@ conditions.
241
241
``count`` and ``estimated_count`` Methods
242
242
-----------------------------------------
243
243
244
- The ``count`` method on model classes and ``Criteria`` objects is now using
245
- the ``count_documents`` driver helper. This makes ``count`` seamlessly work
246
- in transactions.
244
+ Minor change: the ``count`` method on model classes and ``Criteria`` objects
245
+ is now using the ``count_documents`` driver helper. This makes ``count``
246
+ seamlessly work in transactions.
247
247
248
248
Model classes now also have the ``estimated_count`` method to obtain an
249
249
approximate number of documents in the collection. This method is roughly
@@ -253,20 +253,30 @@ equivalent to the ``count`` method in Mongoid 7.1 and earlier, except
253
253
The new behavior is further described in the :ref:`Additional Query Methods
254
254
<additional-query-methods>` section.
255
255
256
+
256
257
``any?`` on ``has_many`` Associations
257
258
-------------------------------------
258
259
259
- The :ref:`any? method on has_many associations <has-many-any>` was optimized
260
- to only retrieve the _id field when querying the database, instead of loading
261
- the entire association.
260
+ Minor change: the :ref:`any? method on has_many associations <has-many-any>`
261
+ was optimized to only retrieve the _id field when querying the database,
262
+ instead of loading the entire association.
263
+
264
+
265
+ ``StringifiedSymbol`` Field Type
266
+ --------------------------------
267
+
268
+ New feature: the :ref:`StringifiedSymbol field type <stringified-symbol>`
269
+ was added for storing Ruby symbol values in MongoDB in a manner interoperable
270
+ with other programming languages.
262
271
263
272
264
273
Changing the Discriminator Key
265
274
------------------------------
266
275
267
- Mongoid now supports :ref:`changing the default discriminator key <discriminator-key>` from the default ``_type`` when using
268
- inheritance. This can be done by setting the ``discriminator_key`` field on the parent class or globally.
269
- To set the discriminator key on the parent class:
276
+ New feature: Mongoid now supports :ref:`changing the default discriminator key
277
+ <discriminator-key>` from the default ``_type`` when using inheritance.
278
+ This can be done by setting the ``discriminator_key`` field on the parent class
279
+ or globally. To set the discriminator key on the parent class:
270
280
271
281
.. code-block:: ruby
272
282
@@ -298,11 +308,14 @@ To set the discrminator key globally:
298
308
class Rectangle < Shape
299
309
end
300
310
311
+
301
312
Changing the Discriminator Value
302
313
--------------------------------
303
314
304
- Mongoid now also supports :ref:`changing the discriminator value <discriminator-value>` from the default value, which is the class name.
305
- The discriminator value can be changed by setting the ``discriminator_value`` on that class:
315
+ New feature: Mongoid now also supports :ref:`changing the discriminator value
316
+ <discriminator-value>` from the default value, which is the class name.
317
+ The discriminator value can be changed by setting the ``discriminator_value``
318
+ on that class:
306
319
307
320
.. code-block:: ruby
308
321
@@ -318,7 +331,6 @@ The discriminator value can be changed by setting the ``discriminator_value`` on
318
331
end
319
332
320
333
321
-
322
334
Shard Key Used For Reloading
323
335
----------------------------
324
336
@@ -362,6 +374,7 @@ Example Mongoid 7.1 behavior:
362
374
Mongoid provides :ref:`sharding management Rake tasks <sharding-management>`
363
375
to shard collections according to shard keys declared in models.
364
376
377
+
365
378
Query Cache Moved to Driver
366
379
---------------------------
367
380
@@ -399,6 +412,7 @@ To read more about the query cache improvements made in the driver, see
399
412
To read more about using the query cache with Mongoid and the limitations
400
413
of the legacy query cache, see :ref:`the query cache documentation <query-cache>`.
401
414
415
+
402
416
Upgrading to Mongoid 7.1
403
417
========================
404
418
0 commit comments