JSON returns JSON bytes with current document
()
| 742 | |
| 743 | // JSON returns JSON bytes with current document |
| 744 | func (it *JSONIterator) JSON() (json []byte) { |
| 745 | if it.ptr < 0 { |
| 746 | panic(errIteratorNotReady) |
| 747 | } |
| 748 | o := it.jsonOffsets[it.ptr] |
| 749 | l := 0 |
| 750 | if it.ptr+1 < len(it.jsonOffsets) { |
| 751 | l = it.jsonOffsets[it.ptr+1] - 1 |
| 752 | } else { |
| 753 | l = len(it.json) - 2 |
| 754 | } |
| 755 | return it.json[o:l] |
| 756 | } |
| 757 | |
| 758 | // GetExplainResults returns JSON bytes with explain results |
| 759 | func (it *JSONIterator) GetExplainResults() (*ExplainResults, error) { |
no outgoing calls