File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -211,3 +211,24 @@ The query cache also caches the results of aggregation pipelines. For example:
211211 Aggregation results are cleared from the cache during every write operation,
212212 with no exceptions.
213213
214+ System Collections
215+ ==================
216+
217+ MongoDB stores system information in collections that use the ``database.system.*``
218+ namespace pattern.
219+
220+ When the query cache is enabled, it will cache all system collection results.
221+ However, system collections are not subject to the same cache invalidation rules
222+ as normal collections; if your app relies on up-to-date information from
223+ system collections, please ensure that you are performing queries against the
224+ system collections with the query cache disabled, as demonstrated below.
225+
226+ .. code-block:: ruby
227+
228+ Mongo::QueryCache.uncached do
229+ Mongo::Client.new([ '127.0.0.1:27017' ], database: 'admin') do |client|
230+ users = client['system.users'].find.to_a
231+ #=> Does not return cached results
232+ end
233+ end
234+
You can’t perform that action at this time.
0 commit comments