Remove the element at a specific index from a list. :param index: The index to remove :param kwargs: Arguments to :meth:`mutate_in` :return: :class:`OperationResult` :raise: :exc:`IndexError` if the index does not exist :raise: :cb_exc:`DocumentNotFo
(self, index: int)
| 250 | raise InvalidArgumentException(message=f'Index: {index} is out of range.') from None |
| 251 | |
| 252 | async def remove_at(self, index: int) -> None: |
| 253 | """ |
| 254 | Remove the element at a specific index from a list. |
| 255 | |
| 256 | :param index: The index to remove |
| 257 | :param kwargs: Arguments to :meth:`mutate_in` |
| 258 | :return: :class:`OperationResult` |
| 259 | :raise: :exc:`IndexError` if the index does not exist |
| 260 | :raise: :cb_exc:`DocumentNotFoundException` if the list does not exist |
| 261 | """ |
| 262 | op_type = DatastructureOperationType.ListRemoveAt |
| 263 | async with ObservableRequestHandler(op_type, self._impl.observability_instruments) as ds_obs_handler: |
| 264 | ds_obs_handler.create_kv_span(self._impl._request_builder._collection_dtls.get_details_as_dict()) |
| 265 | kv_op_type = KeyValueOperationType.MutateIn |
| 266 | async with ObservableRequestHandler(kv_op_type, self._impl.observability_instruments) as obs_handler: |
| 267 | try: |
| 268 | op = remove(f'[{index}]') |
| 269 | req = self._impl.request_builder.build_mutate_in_request(self._key, |
| 270 | (op,), |
| 271 | obs_handler, |
| 272 | parent_span=ds_obs_handler.wrapped_span) |
| 273 | await self._execute_op(self._impl.mutate_in, |
| 274 | req, |
| 275 | obs_handler, |
| 276 | ds_obs_handler.wrapped_span) |
| 277 | except PathNotFoundException: |
| 278 | raise InvalidArgumentException(message=f'Index: {index} is out of range.') from None |
| 279 | |
| 280 | async def size(self) -> int: |
| 281 | """ |