Documentation ¶
Index ¶
- func CreateIndex(c *mongo.Collection, opts ...*IndexOption) error
- func CursorList(c *mongo.Collection, opt *ListOption) (cursor *mongo.Cursor, err error)
- func List(c *mongo.Collection, opt *ListOption, results interface{}) error
- func RemoveIndex(c *mongo.Collection, indexNames ...string) error
- func RemoveIndexByOption(c *mongo.Collection, opts ...*IndexOption) error
- type IndexOption
- type ListOption
- type MongoDriver
- func (d *MongoDriver) DeleteFile(gridfsBucketName, fileID string) error
- func (d *MongoDriver) DownloadFile(gridfsBucketName, fileID string) (fileInfo *gridfs.File, fileContent []byte, err error)
- func (d *MongoDriver) GetCollection(name string) *mongo.Collection
- func (d *MongoDriver) GetFileDownloadStream(gridfsBucketName, fileID string) (stream *gridfs.DownloadStream, err error)
- func (d *MongoDriver) GetGridfsBucket(name string) (bucket *gridfs.Bucket, err error)
- func (d *MongoDriver) UploadFile(gridfsBucketName, fileID, fileName string, fileContent []byte) error
- type MongoDriverOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateIndex ¶
func CreateIndex(c *mongo.Collection, opts ...*IndexOption) error
func CursorList ¶
func CursorList(c *mongo.Collection, opt *ListOption) (cursor *mongo.Cursor, err error)
func List ¶
func List(c *mongo.Collection, opt *ListOption, results interface{}) error
func RemoveIndex ¶
func RemoveIndex(c *mongo.Collection, indexNames ...string) error
func RemoveIndexByOption ¶
func RemoveIndexByOption(c *mongo.Collection, opts ...*IndexOption) error
Types ¶
type IndexOption ¶
type ListOption ¶
type MongoDriver ¶
type MongoDriver struct {
// contains filtered or unexported fields
}
func NewMongoDriver ¶
func NewMongoDriver(opts MongoDriverOptions) (*MongoDriver, error)
func (*MongoDriver) DeleteFile ¶
func (d *MongoDriver) DeleteFile(gridfsBucketName, fileID string) error
func (*MongoDriver) DownloadFile ¶
func (*MongoDriver) GetCollection ¶
func (d *MongoDriver) GetCollection(name string) *mongo.Collection
func (*MongoDriver) GetFileDownloadStream ¶
func (d *MongoDriver) GetFileDownloadStream(gridfsBucketName, fileID string) (stream *gridfs.DownloadStream, err error)
func (*MongoDriver) GetGridfsBucket ¶
func (d *MongoDriver) GetGridfsBucket(name string) (bucket *gridfs.Bucket, err error)
func (*MongoDriver) UploadFile ¶
func (d *MongoDriver) UploadFile(gridfsBucketName, fileID, fileName string, fileContent []byte) error
Click to show internal directories.
Click to hide internal directories.