Skip to content

Commit b871c1b

Browse files
author
Emily Giurleo
authored
MONGOID-5000 Add a test for bypassing the query cache on system collections (#4893)
1 parent 2e5ee49 commit b871c1b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

source/tutorials/mongoid-queries.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,6 +1050,21 @@ will query the database and separately cache their results.
10501050

10511051
To use the cached results, call ``all.to_a.first`` on the model class.
10521052

1053+
System Collections and the Query Cache
1054+
``````````````````````````````````````
1055+
1056+
MongoDB stores system information in collections that use the ``database.system.*``
1057+
namespace pattern. These are called system collections.
1058+
1059+
Data in system collections can change due to activity not triggered by the
1060+
application (such as internal server processes) and as a result of a variety of
1061+
database commands issued by the application. Because of the difficulty of
1062+
determining when the cached results for system collections should be expired,
1063+
queries on system collections bypass the query cache.
1064+
1065+
Neither the legacy query cache nor the driver query cache will cache query
1066+
results from system collections.
1067+
10531068
.. code-block:: ruby
10541069

10551070
Band.all.to_a

0 commit comments

Comments
 (0)