Creating a tailable cursor on MongoDB 3 with the Java driver API
Having recently migrated Graticule’s backend to MongoDB 3 (which was surprisingly easy), I’ve noticed a lot of the methods used in the Java driver have been deprecated.
Most of them were easy to figure out, but tailable cursors presented a bit of a challenge.
I haven’t been able to find a clear-cut example online, so here’s one:
That code applies to the
CursorType is an enum and it has the following values:
Corresponding to the old
DBCursor.addOption Bytes types:
I hope that helps.