Documentation ¶
Index ¶
- Variables
- type Client
- func (c Client) Aggregate(collectionName string, pipeline interface{}) (*types.FindResult, error)
- func (c Client) CreateIndexes(collectionName string, data interface{}) ([]string, error)
- func (c Client) DropIndexes(collectionName string) ([]interface{}, error)
- func (c Client) Duplicate(method string, request types.IRequest, data interface{})
- func (c Client) DuplicateProcessor()
- func (c Client) Find(collectionName string, selector map[string]interface{}, ...) (*types.FindResult, error)
- func (c Client) FindOne(collectionName string, selector map[string]interface{}) (map[string]interface{}, error)
- func (c Client) GetCollection(collectionName string) *mongo.Collection
- func (c Client) GetIndexes(collectionName string) ([]interface{}, error)
- func (c Client) Insert(collectionName string, doc interface{}) (*mongo.InsertOneResult, error)
- func (c Client) InsertMany(collectionName string, docs []interface{}) (*mongo.InsertManyResult, error)
- func (c Client) Remove(collectionName string, selector map[string]interface{}) error
- func (c Client) Update(collectionName string, selector map[string]interface{}, update interface{}) (*mongo.UpdateResult, error)
- func (c Client) Upsert(collectionName string, selector map[string]interface{}, update interface{}) error
- type DuplicateData
- type DuplicateRequest
- type IndexData
- type IndexElement
- type IndexesData
Constants ¶
This section is empty.
Variables ¶
View Source
var DuplicateCh chan DuplicateRequest
Functions ¶
This section is empty.
Types ¶
type Client ¶
func NewMongoClient ¶
func NewMongoClient(config *types.StorageConfig) (*Client, error)
func (Client) Aggregate ¶
func (c Client) Aggregate(collectionName string, pipeline interface{}) (*types.FindResult, error)
func (Client) CreateIndexes ¶ added in v1.0.7
func (Client) DropIndexes ¶ added in v1.1.2
func (Client) DuplicateProcessor ¶
func (c Client) DuplicateProcessor()
func (Client) GetCollection ¶
func (c Client) GetCollection(collectionName string) *mongo.Collection
func (Client) GetIndexes ¶ added in v1.0.7
func (Client) Insert ¶
func (c Client) Insert(collectionName string, doc interface{}) (*mongo.InsertOneResult, error)
func (Client) InsertMany ¶
func (c Client) InsertMany(collectionName string, docs []interface{}) (*mongo.InsertManyResult, error)
type DuplicateData ¶
type DuplicateData struct { Method string `json:"method"` Data interface{} `json:"data"` Processed interface{} `json:"processed"` }
type DuplicateRequest ¶
type DuplicateRequest struct { Method string `json:"method"` Data DuplicateData `json:"data"` }
type IndexElement ¶ added in v1.0.7
type IndexElement struct { Key string `json:"key" bson:"key"` Value interface{} `json:"value" bson:"value"` }
type IndexesData ¶ added in v1.0.7
type IndexesData []IndexData
Click to show internal directories.
Click to hide internal directories.