The current implementation of MongoBetween uses a cursor caching solution with N >= 1 Mongos (LB7), so cursors being pinned to servers is acceptable. However, when load-balancing at the TCP layer it is not possible to target the same Mongos behind a load balancer when pooling connections (which is done under the hood in the Go Driver). This PR proposes pinning cursors and transactions to connections to account for this.
The current implementation of MongoBetween uses a cursor caching solution with N >= 1 Mongos (LB7), so cursors being pinned to servers is acceptable. However, when load-balancing at the TCP layer it is not possible to target the same Mongos behind a load balancer when pooling connections (which is done under the hood in the Go Driver). This PR proposes pinning cursors and transactions to connections to account for this.