Documentation ¶
Overview ¶
gomongoclient implements and simplify the mongodb-driver usage
Index ¶
- type MongoDB
- func (m *MongoDB) Done() (err error)
- func (m *MongoDB) Find(collection string, query interface{}, limit int64) (result []bson.M, err error)
- func (m *MongoDB) FindAndConvert(collection string, query interface{}, sort interface{}, limit int64) (cur *mongo.Cursor, err error)
- func (m *MongoDB) Init() (err error)
- func (m *MongoDB) Insert(collection string, query interface{}) error
- func (m *MongoDB) InsertMany(collection string, query []interface{}, ordered bool) error
- func (m *MongoDB) Ping(connectOnFailure bool) (err error)
- func (m *MongoDB) Test() string
- func (m *MongoDB) Update(collection string, filter bson.M, update bson.M)
- func (m *MongoDB) Upsert(collection string, values bson.M, filter bson.M) error
- func (m *MongoDB) UpsertMany(collection string, query interface{}, filter interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoDB ¶
type MongoDB struct { Host string Port int User string Password string Database string // contains filtered or unexported fields }
func (*MongoDB) Find ¶
func (m *MongoDB) Find(collection string, query interface{}, limit int64) (result []bson.M, err error)
Find the values from given query
func (*MongoDB) FindAndConvert ¶
func (m *MongoDB) FindAndConvert(collection string, query interface{}, sort interface{}, limit int64) (cur *mongo.Cursor, err error)
FindAndConvert return the mongo cursor to use in struct conversion
func (*MongoDB) InsertMany ¶
InsertMany values to the given collection
func (*MongoDB) UpsertMany ¶
UpsertMany records on the mongo database
Click to show internal directories.
Click to hide internal directories.