()
| 131 | it('should correctly execute cursor count with secondary readPreference', { |
| 132 | metadata: { requires: { topology: 'replicaset' } }, |
| 133 | async test() { |
| 134 | const bag = []; |
| 135 | client.on('commandStarted', filterForCommands(['count'], bag)); |
| 136 | |
| 137 | const cursor = client |
| 138 | .db() |
| 139 | .collection('countTEST') |
| 140 | .find({ qty: { $gt: 4 } }); |
| 141 | await cursor.count({ readPreference: ReadPreference.SECONDARY }); |
| 142 | |
| 143 | const selectedServerAddress = bag[0].address |
| 144 | .replace('127.0.0.1', 'localhost') |
| 145 | .replace('[::1]', 'localhost'); |
| 146 | const selectedServer = client.topology.description.servers.get(selectedServerAddress); |
| 147 | expect(selectedServer).property('type').to.equal(ServerType.RSSecondary); |
| 148 | } |
| 149 | }); |
| 150 | |
| 151 | it('shouldThrowErrorOnEachWhenMissingCallback', { |
nothing calls this directly
no test coverage detected