Documentation ¶
Index ¶
- func CreateIndexes(ctx context.Context, col *mongo.Collection, indexes []mongo.IndexModel, ...) error
- func MongoDatabase(mongo_uri string, database string) *mongo.Database
- func NoBootstrap(db *mongo.Database) error
- type BallotRepositoryConf
- type Client
- type Collection
- type MongoCollection
- func (col *MongoCollection) Drop() error
- func (col *MongoCollection) Find(filter interface{}, dest interface{}) error
- func (col *MongoCollection) FindByID(id primitive.ObjectID, dest interface{}) error
- func (col *MongoCollection) FindOne(filter interface{}, dest interface{}) error
- func (col *MongoCollection) InsertMany(data []interface{}) error
- func (col *MongoCollection) InsertOne(data interface{}) (primitive.ObjectID, error)
- func (col *MongoCollection) UpdateOne(filter interface{}, update map[string]interface{}) error
- type RepositoryClient
- type RepositoryConf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateIndexes ¶
func CreateIndexes(ctx context.Context, col *mongo.Collection, indexes []mongo.IndexModel, dropIndexes bool) error
func NoBootstrap ¶
Types ¶
type BallotRepositoryConf ¶
type BallotRepositoryConf struct { }
type Client ¶
type Client interface {
Col(collection string) Collection
}
type Collection ¶
type Collection interface { UpdateOne(filter interface{}, update map[string]interface{}) error FindOne(filter interface{}, dest interface{}) error Find(filter interface{}, dest interface{}) error FindByID(id primitive.ObjectID, dest interface{}) error InsertOne(data interface{}) (primitive.ObjectID, error) InsertMany(data []interface{}) error Drop() error }
func NewWithCollection ¶
func NewWithCollection(name string, col *mongo.Collection) Collection
type MongoCollection ¶
type MongoCollection struct {
// contains filtered or unexported fields
}
func (*MongoCollection) Drop ¶
func (col *MongoCollection) Drop() error
func (*MongoCollection) Find ¶
func (col *MongoCollection) Find(filter interface{}, dest interface{}) error
func (*MongoCollection) FindByID ¶
func (col *MongoCollection) FindByID(id primitive.ObjectID, dest interface{}) error
func (*MongoCollection) FindOne ¶
func (col *MongoCollection) FindOne(filter interface{}, dest interface{}) error
func (*MongoCollection) InsertMany ¶
func (col *MongoCollection) InsertMany(data []interface{}) error
func (*MongoCollection) InsertOne ¶
func (col *MongoCollection) InsertOne(data interface{}) (primitive.ObjectID, error)
func (*MongoCollection) UpdateOne ¶
func (col *MongoCollection) UpdateOne(filter interface{}, update map[string]interface{}) error
type RepositoryClient ¶
type RepositoryClient struct { Conf RepositoryConf Db *mongo.Database }
func (*RepositoryClient) Col ¶
func (c *RepositoryClient) Col(collection string) Collection
type RepositoryConf ¶
Click to show internal directories.
Click to hide internal directories.