Get is used to construct a ResultIterator over all the rows that match the given constraints of an index. The index values must match exactly (this is not a range-based or prefix-based lookup) by default. Prefix lookups: if the named index implements PrefixIndexer, you may perform prefix-based look
(table, index string, args ...interface{})
| 742 | // See the documentation for ResultIterator to understand the behaviour of the |
| 743 | // returned ResultIterator. |
| 744 | func (txn *Txn) Get(table, index string, args ...interface{}) (ResultIterator, error) { |
| 745 | indexIter, val, err := txn.getIndexIterator(table, index, args...) |
| 746 | if err != nil { |
| 747 | return nil, err |
| 748 | } |
| 749 | |
| 750 | // Seek the iterator to the appropriate sub-set |
| 751 | watchCh := indexIter.SeekPrefixWatch(val) |
| 752 | |
| 753 | // Create an iterator |
| 754 | iter := &radixIterator{ |
| 755 | iter: indexIter, |
| 756 | watchCh: watchCh, |
| 757 | } |
| 758 | return iter, nil |
| 759 | } |
| 760 | |
| 761 | // GetReverse is used to construct a Reverse ResultIterator over all the |
| 762 | // rows that match the given constraints of an index. |