Skip to content

Commit c797668

Browse files
committed
PYTHON-299: Adding support for ReadPreference on ReplicaSetConnections for Collection.inline_map_reduce.
1 parent 3f76c9a commit c797668

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pymongo/collection.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,9 +1120,12 @@ def inline_map_reduce(self, map, reduce, full_response=False, **kwargs):
11201120
.. versionadded:: 1.10
11211121
"""
11221122

1123+
use_master = not self.slave_okay and not self.read_preference
1124+
11231125
response = self.__database.command("mapreduce", self.__name,
11241126
uuid_subtype=self.__uuid_subtype,
11251127
map=map, reduce=reduce,
1128+
_use_master=use_master,
11261129
out={"inline": 1}, **kwargs)
11271130

11281131
if full_response:

0 commit comments

Comments
 (0)