# Java API to append/insert a Key:Value pair if a bin already has Map type data

**URL:** <https://discuss.aerospike.com/t/java-api-to-append-insert-a-key-value-pair-if-a-bin-already-has-map-type-data/6828>\
**Category:** General Discussion\
**Created:** [November 15, 2019, 2:05am UTC](https://discuss.aerospike.com/t/java-api-to-append-insert-a-key-value-pair-if-a-bin-already-has-map-type-data/6828 "2019-11-15T02:05:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vnagineni](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/vnagineni/32/1366_2.png) [@vnagineni](https://discuss.aerospike.com/u/vnagineni)\
**Post date:** [November 15, 2019, 2:05am UTC](https://discuss.aerospike.com/t/java-api-to-append-insert-a-key-value-pair-if-a-bin-already-has-map-type-data/6828/1 "2019-11-15T02:05:09Z")

</div>

If we are storing a MAP of data in a record and in a bin, we can use PUT API. For the given record it overwrites the existing data in BIN. Is there any API available to just add a new Key:Val pair in a existing map in existing bin?

For simple data types like String, I see API is available to do APPEND. But I could not find equivalent one if MAP is stored in a BIN. any API Available for the same?

---

<div class="post-metadata">

**Author:** ![kporter](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/kporter/32/515_2.png) [@kporter](https://discuss.aerospike.com/u/kporter)\
**Post date:** [November 15, 2019, 5:30pm UTC](https://discuss.aerospike.com/t/java-api-to-append-insert-a-key-value-pair-if-a-bin-already-has-map-type-data/6828/2 "2019-11-15T17:30:07Z")

</div>

There are several APIs to choose from: [https://www.aerospike.com/docs/guide/cdt-map-ops.html#add](https://www.aerospike.com/docs/guide/cdt-map-ops.html#add).
