Documentation ¶
Index ¶
- type Collection
- func (c *Collection) DeleteOne(filter interface{}) (*mongo.DeleteResult, error)
- func (c *Collection) Find(filter interface{}, opts ...*options.FindOptions) (CursorAPI, error)
- func (c *Collection) FindOne(filter interface{}, opts ...*options.FindOneOptions) SingleResultAPI
- func (c *Collection) GetCollection() *mongo.Collection
- func (c *Collection) InsertMany(documents []interface{}) (*mongo.InsertManyResult, error)
- func (c *Collection) InsertOne(document interface{}) (*mongo.InsertOneResult, error)
- func (c *Collection) ReplaceOne(filter interface{}, document interface{}) (*mongo.UpdateResult, error)
- func (c *Collection) UpdateOne(filter interface{}, document interface{}) (*mongo.UpdateResult, error)
- type CollectionAPI
- type CursorAPI
- type Database
- type DatabaseAPI
- type SingleResultAPI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
func (*Collection) DeleteOne ¶
func (c *Collection) DeleteOne(filter interface{}) (*mongo.DeleteResult, error)
func (*Collection) Find ¶
func (c *Collection) Find(filter interface{}, opts ...*options.FindOptions) (CursorAPI, error)
func (*Collection) FindOne ¶
func (c *Collection) FindOne(filter interface{}, opts ...*options.FindOneOptions) SingleResultAPI
func (*Collection) GetCollection ¶
func (c *Collection) GetCollection() *mongo.Collection
func (*Collection) InsertMany ¶
func (c *Collection) InsertMany(documents []interface{}) (*mongo.InsertManyResult, error)
func (*Collection) InsertOne ¶
func (c *Collection) InsertOne(document interface{}) (*mongo.InsertOneResult, error)
func (*Collection) ReplaceOne ¶
func (c *Collection) ReplaceOne(filter interface{}, document interface{}) (*mongo.UpdateResult, error)
func (*Collection) UpdateOne ¶
func (c *Collection) UpdateOne(filter interface{}, document interface{}) (*mongo.UpdateResult, error)
type CollectionAPI ¶
type CollectionAPI interface { InsertOne(document interface{}) (*mongo.InsertOneResult, error) InsertMany(documents []interface{}) (*mongo.InsertManyResult, error) UpdateOne(filter interface{}, document interface{}) (*mongo.UpdateResult, error) ReplaceOne(filter interface{}, document interface{}) (*mongo.UpdateResult, error) FindOne(filter interface{}, opts ...*options.FindOneOptions) SingleResultAPI Find(filter interface{}, opts ...*options.FindOptions) (CursorAPI, error) DeleteOne(filter interface{}) (*mongo.DeleteResult, error) }
func NewCollection ¶
func NewCollection(collection *mongo.Collection) CollectionAPI
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func (*Database) Collection ¶
func (d *Database) Collection(s string) CollectionAPI
type DatabaseAPI ¶
type DatabaseAPI interface {
Collection(string) CollectionAPI
}
func NewDatabase ¶
func NewDatabase(db *mongo.Database) DatabaseAPI
Click to show internal directories.
Click to hide internal directories.