# Why can't get the key-value I need for using fdb\_transaction\_get\_range

**URL:** <https://forums.foundationdb.org/t/why-cant-get-the-key-value-i-need-for-using-fdb-transaction-get-range/3038>\
**Category:** Using FoundationDB\
**Created:** [November 25, 2021, 9:15am UTC](https://forums.foundationdb.org/t/why-cant-get-the-key-value-i-need-for-using-fdb-transaction-get-range/3038 "2021-11-25T09:15:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JiangXiNJU](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/jiangxinju/32/1247_2.png) [@JiangXiNJU](https://forums.foundationdb.org/u/JiangXiNJU)\
**Post date:** [November 25, 2021, 9:15am UTC](https://forums.foundationdb.org/t/why-cant-get-the-key-value-i-need-for-using-fdb-transaction-get-range/3038/1 "2021-11-25T09:15:16Z")

</div>

Hi. I have already set a kv (‘\x00\x05\x00\x00\x00\x00\x00\x00movie’ ，’\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00’) into the fdb. And I can search this with fdbcli getrange \x00\x05 \x00\xff.

But when I use C API (version 630), something strange happened.  
When the code is :

```auto
 uint8_t startUint[2] = {0x0, 0x5};
    uint8_t endUnit[2] = {254, 254};
    FDBFuture *future = fdb_transaction_get_range(tr, startUint, 2, 0, 1,
                                                      endUnit, 2, 1, 0,
                                                  0, 0, FDB_STREAMING_MODE_LARGE, 0, 0, 0);

```

then I get the kv.

When the code is :

```auto
uint8_t startUint[2] = {0x0, 0x5};
    uint8_t endUnit[2] = {0x0, 254};
    FDBFuture *future = fdb_transaction_get_range(tr, startUint, 2, 0, 1,
                                                      endUnit, 2, 1, 0,
                                                  0, 0, FDB_STREAMING_MODE_LARGE, 0, 0, 0);

```

I got Nothing !  
Can Anyone help ?

---

<div class="post-metadata">

**Author:** ![JiangXiNJU](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/jiangxinju/32/1247_2.png) [@JiangXiNJU](https://forums.foundationdb.org/u/JiangXiNJU)\
**Post date:** [November 27, 2021, 3:37am UTC](https://forums.foundationdb.org/t/why-cant-get-the-key-value-i-need-for-using-fdb-transaction-get-range/3038/2 "2021-11-27T03:37:15Z")

</div>

when I fix the code as below:

```auto
uint8_t startUint[2] = {0x0, 0x5};
uint8_t endUnit[2] = {0x0, 254};
FDBFuture *future = fdb_transaction_get_range(tr, startUint, 2, 1, 0,
                                                      endUnit, 2, 0, 1,
                                                  0, 0, FDB_STREAMING_MODE_LARGE, 0, 0, 0);

```

I can get the kv again  
Then I change the startUint[3]={0x0, 0x5,0x2}  
I run

```auto
FDBFuture *future = fdb_transaction_get_range(tr, startUint, 2, 1, 0,
                                                      endUnit, 2, 0, 1,
                                                  0, 0, FDB_STREAMING_MODE_LARGE, 0, 0, 0);

```

I get the kv too !

I 'm totally confused!

can anyone answer that???
