Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoDocuments record not found error ErrNoDocuments error = mongo.ErrNoDocuments // DefaultTimeout is the default timeout for any interaction with the Mongo DB DefaultTimeout = 5 * time.Second )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { Health(context.Context) error Disconnect(context.Context) Collection(name string, opts ...*options.CollectionOptions) Collection }
Client represents the client to interact with a Mongo DB
type Collection ¶
type Collection interface { InsertOne(ctx context.Context, document interface{}, opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error) FindOne(ctx context.Context, filter interface{}, opts ...*options.FindOneOptions) Result Aggregate(ctx context.Context, pipeline interface{}, opts ...*options.AggregateOptions) (*mongo.Cursor, error) }
Collection is the interface to interact with a mongo collection
Click to show internal directories.
Click to hide internal directories.