In many examples I find for using tailable cursors on capped collections, the code includes:
hint( { $natural: 1 } )
(e.g. here), including the official docs (here), to "ensure we don't use any indexes", and that results are returned in natural (i.e. disk) order.
However, the docs also suggest this is the default behavior of tailable cursors:
Tailable cursors do not use indexes and return documents in natural order.
So is the use of the hint
redundant?
I tried looking at the output of explain()
with and without the hint
, and as far as I can tell, there was no difference.