Abacn commented on code in PR #22400:
URL: https://github.com/apache/beam/pull/22400#discussion_r983982931
##########
sdks/python/apache_beam/io/mongodbio.py:
##########
@@ -772,36 +796,46 @@ def display_data(self):
class _MongoSink:
- def __init__(self, uri=None, db=None, coll=None, extra_params=None):
+ def __init__(
+ self, uri=None, db=None, coll=None, extra_params=None, writeFn=None):
if extra_params is None:
extra_params = {}
self.uri = uri
self.db = db
self.coll = coll
self.spec = extra_params
self.client = None
+ self.writeFn = writeFn
+ if writeFn is None:
+ self.writeFn = self._defaultWriteFn
+
+ @staticmethod
+ def _defaultWriteFn(client, db, coll, documents, logger):
Review Comment:
We can name this as _replaceOneWriteFunc, and also provide a
_updateOneWriteFunc
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]