Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Query ¶
type Query[T any] interface { Close() CreateIndexes(indexes []mongo.IndexModel) error FindOne(filter bson.M, opts *options.FindOneOptions) (*T, error) FindAll(filter bson.M, opts *options.FindOptions) ([]*T, error) FindPaginated(filter bson.M, page int64, limit int64, opts *options.FindOptions) ([]*T, error) InsertOne(doc *T) (*primitive.ObjectID, error) InsertAndRetrieveOne(doc *T) (*T, error) InsertMany(doc []*T) ([]primitive.ObjectID, error) InsertAndRetrieveMany(doc []*T) ([]*T, error) UpdateOne(filter bson.M, update bson.M) (*mongo.UpdateResult, error) UpdateMany(filter bson.M, update bson.M) (*mongo.UpdateResult, error) DeleteOne(filter bson.M) (*mongo.DeleteResult, error) }
type QueryBuilder ¶
type QueryBuilder[T any] interface { GetCollection() *mongo.Collection SingleQuery() Query[T] Query(context context.Context) Query[T] }
func NewQueryBuilder ¶
func NewQueryBuilder[T any](db Database, collectionName string) QueryBuilder[T]
Click to show internal directories.
Click to hide internal directories.