Add an item to the end of the list. Args: value (JSONType): The value to add.
(self, value: JSONType)
| 134 | transcoder=transcoder) |
| 135 | |
| 136 | def append(self, value: JSONType) -> None: |
| 137 | """Add an item to the end of the list. |
| 138 | |
| 139 | Args: |
| 140 | value (JSONType): The value to add. |
| 141 | |
| 142 | """ |
| 143 | op_type = DatastructureOperationType.ListAppend |
| 144 | with ObservableRequestHandler(op_type, self._impl.observability_instruments) as ds_obs_handler: |
| 145 | ds_obs_handler.create_kv_span(self._impl._request_builder._collection_dtls.get_details_as_dict()) |
| 146 | kv_op_type = KeyValueOperationType.MutateIn |
| 147 | with ObservableRequestHandler(kv_op_type, self._impl.observability_instruments) as obs_handler: |
| 148 | op = array_append('', value) |
| 149 | req = self._impl.request_builder.build_mutate_in_request(self._key, |
| 150 | (op,), |
| 151 | obs_handler, |
| 152 | parent_span=ds_obs_handler.wrapped_span) |
| 153 | self._execute_op(self._impl.mutate_in, |
| 154 | req, |
| 155 | obs_handler, |
| 156 | ds_obs_handler.wrapped_span, |
| 157 | create_type=True) |
| 158 | |
| 159 | def prepend(self, value: JSONType) -> None: |
| 160 | """Add an item to the beginning of the list. |
no test coverage detected