@abstractmethod
def set_field_of_each_document(
self,
collection_name: str,
field_name: str,
value: Union[None, str, int, float, bool],
) -> None:
r"""
Populates the specified field of each document in the collection, with the
specified value (that same value will be used for each document).
"""
pass
This method would be similar to the process_each_document method, but — since the value is independent of anything else — we can use Mongo's update function, which I think will be faster (in terms of execution time) than the "ETL" process used by process_each_document.
Proposed method signature
This method would be similar to the
process_each_document
method, but — since the value is independent of anything else — we can use Mongo'supdate
function, which I think will be faster (in terms of execution time) than the "ETL" process used byprocess_each_document
.