First is used to return the first matching object for the given constraints on the index. Note that all values read in the transaction form a consistent snapshot from the time when the transaction was created.
(table, index string, args ...interface{})
| 603 | // Note that all values read in the transaction form a consistent snapshot |
| 604 | // from the time when the transaction was created. |
| 605 | func (txn *Txn) First(table, index string, args ...interface{}) (interface{}, error) { |
| 606 | _, val, err := txn.FirstWatch(table, index, args...) |
| 607 | return val, err |
| 608 | } |
| 609 | |
| 610 | // Last is used to return the last matching object for |
| 611 | // the given constraints on the index. |