best database for storing arrays with set-like sum operation

I need a simple database to store key-array pairs with the ability to update the stored arrays with merging new array into them, without duplicated values. In fact, I need to store ordered “sets”. For example, records in the database looks like:

key : value (an array)

“1” : [ 1, 2, 3, 4]

“2” : [ 1, 3, 5, 7, 11] …

and I want to be able to merge a new array, like [1, 2, 3, 100, 200, 300] into the first record, while skipping duplicates, resulting the first row to become:

“1” : [ 1, 2, 3, 4, 100, 200, 300]

I also want it to handle partial selection of arrays, example:

select myArrayColumn[0:2] where key = 2 

should result: [1, 3]

I want a suggestion for a database with such capabilities.