user8997135 wrote:It will move the cursor to the first record whose key is 4 and whose data is b or greater than b. If you have the (4,b) record, it will move the cursor to (4,b).
is getSearchBothRange(4,b) going to give me (5,c) or what?
and after it gives me a found, should I do getNext or getNextDup or getNextNoDup?getNext - shows the next/previous record in the database
what do those next mean? are their semantics related to the query before or standalone?
forgot to mention I'm using secondaryCursor. is there any difference?Yes, there is a difference. As I said, if the cursor is on a secondary, it does not search based on a key/data pair, but on a secondary key and a primary key. For more info:
SecondaryCursor sc;First note that "both" with a secondary cursor refers to both secondary key and primary key. The data is not searched on.
// success only if (E,b) exists?
sc.getSearchBothRange(E,b,data,null);No, only the first two would be found. It matches the secondary key exactly, according to the javadoc.
// success if (E,b) exists?
// success if (E,bb) exists?
// success if (EE,b) exists?
// success if (EE,bb) exists?
//assuming cursor is on (E,b,data8), are the following results possible?No, because there cannot be two (E, b, ...) records in a single database.
sc.getNextDup();No, see above.
//(EE,b,data11)?No, since NextDup only returns records with the same secondarykey.
sc.getNextNoDup();No, see above.
//(E,bb,data10)?No, since NexNotDup only returns records with a different secondarykey
//(EE,bb,data12)?No, secondary key is the same as above.