Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertMongoError ¶
func ConvertSortOptionsToMongo ¶
func ConvertSortOptionsToMongo(defaultField string, defaultDirection xpaging.SortDirection, options xpaging.SortOptions) bson.D
func CreateIndexes ¶
func CreateIndexes(logger xlogger.Logger, collection *mongo.Collection, models ...mongo.IndexModel)
CreateIndexes creates one or more indexes in the provided collection reporting the result in the log
Types ¶
type MongoInMemory ¶
type MongoInMemory struct {
// contains filtered or unexported fields
}
MongoInMemory allows to start a MongoDB instance in memory to run tests against To use it, create a new instance of MongoInMemory and call Connect() before running your tests and call Disconnect() after your tests are done. The client to connect to MongoDB can be retrieved by calling Client().
func (*MongoInMemory) Client ¶
func (m *MongoInMemory) Client() *mongo.Client
func (*MongoInMemory) Connect ¶
func (m *MongoInMemory) Connect()
func (*MongoInMemory) Disconnect ¶
func (m *MongoInMemory) Disconnect()
Click to show internal directories.
Click to hide internal directories.