A little experimentation shows the part about
FOLLOWER nodes accepting writes is a resounding "no":
Unhandled exception: No write operations are allowed directly
on this database. Writes must pass through the leader. The role
of this server is: FOLLOWER
Still curious about the routing criteria, though. Is there a place in the docs that highlights it? It's unfortunately hard to google since everything I find just tells me how the driver handles routing for me. Or does it seem more prudent to just provide different methods for read and write queries/transactions where the
write version always goes to the leader?
I suppose I'd have to change up routing after a leader re-election, too. Is there any way to detect that without polling? For example, write errors occurring after the leader fails that I can tell the driver to refresh routing?