func (c *Cursor) TryNext(ctx context.Context) bool {
	return c.next(ctx, true)
}
TryNext attempts to get the next document for this cursor. It returns true if there were no errors and the next
document is available. This is only recommended for use with tailable cursors as a non-blocking alternative to
Next. See https://docs.mongodb.com/manual/core/tailable-cursors/ for more information about tailable cursors.

TryNext returns false if the cursor is exhausted, an error occurs when getting results from the server, the next
document is not yet available, or ctx expires. If ctx expires, the error will be set to ctx.Err().

If TryNext returns false and an error occurred or the cursor has been exhausted (i.e. c.Err() != nil || c.ID() == 0),
subsequent attempts will also return false. Otherwise, it is safe to call TryNext again until a document is
available.

This method requires driver version >= 1.2.0.
package mongo
import (
	"context"
	"errors"
	"fmt"
	"io"
	"reflect"
	"go.mongodb.org/mongo-driver/bson"
	"go.mongodb.org/mongo-driver/bson/bsoncodec"
	"go.mongodb.org/mongo-driver/x/bsonx/bsoncore"
	"go.mongodb.org/mongo-driver/x/mongo/driver"
	"go.mongodb.org/mongo-driver/x/mongo/driver/session"
)
type Cursor struct {
	Current bson.Raw
	bc            batchCursor
	batch         *bsoncore.DocumentSequence
	batchLength   int
	registry      *bsoncodec.Registry
	clientSession *session.Client
	err error
}
func newCursor(bc batchCursor, registry *bsoncodec.Registry) (*Cursor, error) {
	return newCursorWithSession(bc, registry, nil)
}
func newCursorWithSession(bc batchCursor, registry *bsoncodec.Registry, clientSession *session.Client) (*Cursor, error) {
	if registry == nil {
		registry = bson.DefaultRegistry
	}
	if bc == nil {
		return nil, errors.New("batch cursor must not be nil")
	}
	c := &Cursor{
		bc:            bc,
		registry:      registry,
		clientSession: clientSession,
	}
	if bc.ID() == 0 {
		c.closeImplicitSession()
	}
	c.batchLength = c.bc.Batch().DocumentCount()
	return c, nil
}
func newEmptyCursor() *Cursor {
	return &Cursor{bc: driver.NewEmptyBatchCursor()}
}
func (c *Cursor) ID() int64 { return c.bc.ID() }
func (c *Cursor) Next(ctx context.Context) bool {
	return c.next(ctx, false)
}