The _id of the inserted document if an upsert took place. Otherwise ``None``.
(self)
| 160 | |
| 161 | @property |
| 162 | def upserted_id(self) -> Any: |
| 163 | """The _id of the inserted document if an upsert took place. Otherwise |
| 164 | ``None``. |
| 165 | """ |
| 166 | self._raise_if_unacknowledged("upserted_id") |
| 167 | assert self.__raw_result is not None |
| 168 | if self.__in_client_bulk and self.__raw_result.get("upserted"): |
| 169 | return self.__raw_result["upserted"]["_id"] |
| 170 | return self.__raw_result.get("upserted", None) |
| 171 | |
| 172 | @property |
| 173 | def did_upsert(self) -> bool: |
nothing calls this directly
no test coverage detected