# Want to set expiration at bin level

**URL:** <https://discuss.aerospike.com/t/want-to-set-expiration-at-bin-level/1420>\
**Category:** Feature Discussion\
**Created:** [June 23, 2015, 7:49am UTC](https://discuss.aerospike.com/t/want-to-set-expiration-at-bin-level/1420 "2015-06-23T07:49:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Post date:** [June 23, 2015, 7:49am UTC](https://discuss.aerospike.com/t/want-to-set-expiration-at-bin-level/1420/1 "2015-06-23T07:49:24Z")

</div>

I know that we can set Expiration in aerospike at record level. The whole record is going to expire with the expiration set in the policy.

but i want to set expiration at bin level. some where i read we con’t set expiration at bin level. so i’m trying to store all data for particular userid in one bin with different segment\_id (6,8,15). and each segment has Expiration time(ExpTime).  
{“6”:{“from”:“Delhi”, “to”:“Mumbai”, “ExpTime”:“1434580456876”}, “8”:{“from”:“Delhi”, “to”:“Kolkata”, “ExpTime”:“1434580456876”},“15”:{“from”:“India”, “to”:“singapore”,ExpTime":“1434474636210”}}

if i’m going to write UDF to remove segment which has expired. then it will become very costly process. i’m storing json data format in bin.

please suggest other solution
