Documentation ¶
Index ¶
- func C(collectionName string) *mongo.Collection
- func CollectionWithDB(db, coll string) *mongo.Collection
- func Connect(gtx context.Context, uri string, defaultDB string) error
- func ConnectWithOpts(gtx context.Context, opts *ConnOpts) error
- func ReadAllAndClose(gtx context.Context, cur *mongo.Cursor, out interface{}) error
- func ReadOneAndClose(gtx context.Context, cur *mongo.Cursor, out interface{}) error
- func WithMongo(defaultDb string, cmd *cli.Command) *cli.Command
- type ConnOpts
- type ConnType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func C ¶
func C(collectionName string) *mongo.Collection
C - get a handle to collection in the default database, single letter name to have nice way to transition from mgo
func CollectionWithDB ¶
func CollectionWithDB(db, coll string) *mongo.Collection
CollectionWithDB - gives a reference to a collection in given database
func Connect ¶
Connect - connects to a mongoDB instance or a cluster based on the the options provided
func ReadAllAndClose ¶
ReadAllAndClose - reads all data from the cursor and closes it
func ReadOneAndClose ¶
ReadOneAndClose - reads one data item from the cursor and closes it
Types ¶
Click to show internal directories.
Click to hide internal directories.