collection.go 599 B

123456789101112131415161718
  1. //go:generate mockgen -package internal -destination collection_mock.go -source collection.go
  2. package internal
  3. import "github.com/globalsign/mgo"
  4. type MgoCollection interface {
  5. Find(query interface{}) *mgo.Query
  6. FindId(id interface{}) *mgo.Query
  7. Insert(docs ...interface{}) error
  8. Pipe(pipeline interface{}) *mgo.Pipe
  9. Remove(selector interface{}) error
  10. RemoveAll(selector interface{}) (*mgo.ChangeInfo, error)
  11. RemoveId(id interface{}) error
  12. Update(selector, update interface{}) error
  13. UpdateId(id, update interface{}) error
  14. Upsert(selector, update interface{}) (*mgo.ChangeInfo, error)
  15. }