Closed jefferickson closed 6 years ago
Hi @jefferickson
Calling Close()
also returns the error, but has the added benefit of closing the iterator on the server side when done - it's probably best to keep the Close()
in the example as lots of people copy/paste them - is this not what you expect?
Dom
Hey @domodwyer
Ah, that makes sense. I was mostly addressing what I felt was an inconsistency with the paragraph before it (copied here):
// Next returns true if a document was successfully unmarshalled onto result,
// and false at the end of the result set or if an error happened.
// When Next returns false, the Err method should be called to verify if
// there was an error during iteration, and the Timeout method to verify if the
// false return value was caused by a timeout (no available results).
I feel it would be best to mention Close
in the text and then show it in the example or outline all of the options in the text. I'd be happy to write that up if you give me the go-ahead.
Cheers, Jeff
Hi @jefferickson
Makes total sense! We'd be happy to change it 👍 Thanks for taking the time!
Maybe include that both return the iterator error, but close also releases the cursor on the server side?
Dom
@domodwyer Great, I'll take a look this weekend.
Cheers, Jeff
@domodwyer Took a stab at it, let me know if you have any feedback.
Hey @jefferickson
Looks great, thanks for taking the time to clarify the docs - it's easy to forget the importance of clear wording when users are new to the package.
Really appreciated!
Dom
The code example called Iter.Close instead of Iter.Err despite the example text.