Description

Peek behaves similarly to Next, retreiving the next document from the result set and blocking if necessary. Peek, however, does not progress the position of the cursor. This can be useful for expressions which can return different types to attempt to decode them into different interfaces.

Like Next, it will also automatically retrieve another batch of documents from the server when the current one is exhausted, or before that in background if possible.

Unlike Next, Peek does not progress the position of the cursor. Peek will return errors from decoding, but they will not be persisted in the cursor and therefore will not be available on cursor.Err(). This can be useful for expressions that can return different types to attempt to decode them into different interfaces.

Peek returns true if a document was successfully unmarshalled onto result, and false at the end of the result set or if an error happened. Peek also returns the error (if any) that occured

Peek is referenced in 1 repository

github.com/dancannon/gorethink