def matched_count(self):
        """The number of documents matched for this update."""
        self._raise_if_unacknowledged("matched_count")
        if self.upserted_id is not None:
            return 0
        return self.__raw_result.get("n", 0)
The number of documents matched for this update.
stackoverflow/venv/lib/python3.6/site-packages/pymongo/results.py