Documentation ¶
Index ¶
- Constants
- Variables
- func CompareServerVersions(v1 string, v2 string) int
- func IsValidObjectId(s string) bool
- type A
- type Aggregate
- type ArrayFilters
- type Bulk
- type BulkResult
- type ChangeEvent
- type ChangeStream
- type ChangeStreamOptions
- type Client
- type Collation
- type Collection
- type CollectionOptions
- type Config
- type Cursor
- type CursorType
- type D
- type Database
- type DatabaseOptions
- type DateTime
- type Decimal128
- type DeleteManyModel
- type DeleteOneModel
- type DeleteOptions
- type DeleteResult
- type Distinct
- type DocumentKey
- type E
- type EventId
- type FindDelete
- type FindReplace
- type FindUpdate
- type FullDocument
- type IndexOptions
- type IndexView
- type InsertManyOptions
- type InsertManyResult
- type InsertOneModel
- type InsertOneOptions
- type InsertOneResult
- type M
- type Namespace
- type Null
- type ObjectId
- type OperationType
- type Pipeline
- type Query
- type Raw
- type Regex
- type ReplaceOneModel
- type ReplaceOptions
- type ReturnDocument
- type Session
- type SessionContext
- type SessionOptions
- type Timestamp
- type TransactionOptions
- type Tx
- type UpdateManyModel
- type UpdateOneModel
- type UpdateOptions
- type UpdateResult
- type WriteModel
Constants ¶
View Source
const ( Before = options.Before After = options.After )
View Source
const ( Default = options.Default Off = options.Off Required = options.Required UpdateLookup = options.UpdateLookup WhenAvailable = options.WhenAvailable )
View Source
const ( NonTailable = options.NonTailable Tailable = options.Tailable TailableAwait = options.TailableAwait )
View Source
const ( OperationTypeInsert = "insert" OperationTypeDelete = "delete" OperationTypeReplace = "replace" OperationTypeUpdate = "update" OperationTypeInvalidate = "invalidate" )
Variables ¶
View Source
var ErrNoDocuments = mongo.ErrNoDocuments
View Source
var ErrResultNotSlice = errors.New("results argument must be a pointer to a slice")
View Source
var ErrSessionNotSupported = errors.New("session not supported")
Functions ¶
func CompareServerVersions ¶
func IsValidObjectId ¶
Types ¶
type Aggregate ¶
type Aggregate interface { AllowDiskUse(b bool) Aggregate BatchSize(n int32) Aggregate BypassDocumentValidation(b bool) Aggregate Collation(c *Collation) Aggregate Comment(s string) Aggregate Hint(hint interface{}) Aggregate MaxTime(d time.Duration) Aggregate MaxAwaitTime(d time.Duration) Aggregate One(result interface{}) error All(result interface{}) error Cursor() Cursor }
type ArrayFilters ¶
type ArrayFilters = options.ArrayFilters
type Bulk ¶
type Bulk interface { Ordered(ordered bool) Bulk BypassDocumentValidation(bypass bool) Bulk AddModel(m WriteModel) Bulk InsertOne(document interface{}) Bulk InsertOneNx(filter interface{}, document interface{}) Bulk RepsertOne(filter interface{}, replacement interface{}) Bulk ReplaceOne(filter interface{}, replacement interface{}) Bulk UpsertOne(filter interface{}, update interface{}) Bulk UpsertId(id interface{}, update interface{}) Bulk Upsert(filter interface{}, update interface{}) Bulk UpdateOne(filter interface{}, update interface{}) Bulk UpdateId(id interface{}, update interface{}) Bulk UpdateMany(filter interface{}, update interface{}) Bulk DeleteOne(filter interface{}) Bulk DeleteId(id interface{}) Bulk DeleteMany(filter interface{}) Bulk Apply(ctx context.Context) (*BulkResult, error) }
type BulkResult ¶
type BulkResult = mongo.BulkWriteResult
type ChangeEvent ¶
type ChangeEvent struct { Id EventId `bson:"_id"` OperationType OperationType `bson:"operationType"` ClusterTime Timestamp `bson:"clusterTime"` Namespace Namespace `bson:"ns"` WallTime DateTime `bson:"wallTime"` DocumentKey DocumentKey `bson:"documentKey"` }
type ChangeStream ¶ added in v0.0.12
type ChangeStream = mongo.ChangeStream
type ChangeStreamOptions ¶ added in v0.0.12
type ChangeStreamOptions = options.ChangeStreamOptions
func NewChangeStreamOptions ¶ added in v0.0.12
func NewChangeStreamOptions() *ChangeStreamOptions
type Client ¶
type Client interface { Client() *mongo.Client Registry() *bsoncodec.Registry Close(ctx context.Context) error Ping(ctx context.Context) error ServerStatus(ctx context.Context) (bson.Raw, error) ServerVersion() string TransactionAllowed() bool Database(name string, opts ...*DatabaseOptions) Database UseSession(ctx context.Context, fn func(SessionContext) error) error UseSessionWithOptions(ctx context.Context, opts *options.SessionOptions, fn func(SessionContext) error) error StartSession(opts ...*SessionOptions) (Session, error) BeginTx(ctx context.Context, opts ...*TransactionOptions) (Tx, error) Watch(ctx context.Context, pipeline interface{}, opts ...*options.ChangeStreamOptions) (*ChangeStream, error) }
type Collection ¶
type Collection interface { Database() Database Collection() *mongo.Collection Name() string Drop(ctx context.Context) error Clone(opts ...*CollectionOptions) (Collection, error) IndexView() IndexView InsertOne(ctx context.Context, document interface{}, opts ...*InsertOneOptions) (*InsertOneResult, error) InsertOneNx(ctx context.Context, filter interface{}, document interface{}, opts ...*UpdateOptions) (*UpdateResult, error) InsertMany(ctx context.Context, documents []interface{}, opts ...*InsertManyOptions) (*InsertManyResult, error) Insert(ctx context.Context, documents ...interface{}) (*InsertManyResult, error) RepsertOne(ctx context.Context, filter interface{}, replacement interface{}, opts ...*ReplaceOptions) (*UpdateResult, error) ReplaceOne(ctx context.Context, filter interface{}, replacement interface{}, opts ...*ReplaceOptions) (*UpdateResult, error) UpsertOne(ctx context.Context, filter interface{}, update interface{}, opts ...*UpdateOptions) (*UpdateResult, error) UpsertId(ctx context.Context, id interface{}, update interface{}, opts ...*UpdateOptions) (*UpdateResult, error) Upsert(ctx context.Context, filter interface{}, update interface{}, opts ...*UpdateOptions) (*UpdateResult, error) UpdateOne(ctx context.Context, filter interface{}, update interface{}, opts ...*UpdateOptions) (*UpdateResult, error) UpdateId(ctx context.Context, id interface{}, update interface{}, opts ...*UpdateOptions) (*UpdateResult, error) UpdateMany(ctx context.Context, filter interface{}, update interface{}, opts ...*UpdateOptions) (*UpdateResult, error) DeleteOne(ctx context.Context, filter interface{}, opts ...*DeleteOptions) (*DeleteResult, error) DeleteId(ctx context.Context, id interface{}, opts ...*DeleteOptions) (*DeleteResult, error) DeleteMany(ctx context.Context, filter interface{}, opts ...*DeleteOptions) (*DeleteResult, error) Find(ctx context.Context, filter interface{}) Query FindOneAndUpdate(ctx context.Context, filter interface{}, update interface{}) FindUpdate FindOneAndReplace(ctx context.Context, filter interface{}, replacement interface{}) FindReplace FindOneAndDelete(ctx context.Context, filter interface{}) FindDelete Bulk() Bulk Distinct(ctx context.Context, fieldName string, filter interface{}) Distinct Aggregate(ctx context.Context, pipeline interface{}) Aggregate Watch(ctx context.Context, pipeline interface{}, opts ...*options.ChangeStreamOptions) (*ChangeStream, error) }
type CollectionOptions ¶
type CollectionOptions = options.CollectionOptions
func NewCollectionOptions ¶
func NewCollectionOptions() *CollectionOptions
type Config ¶
type Config struct {
*options.ClientOptions
}
type CursorType ¶
type CursorType = options.CursorType
type Database ¶
type Database interface { Client() Client Database() *mongo.Database Name() string Drop(ctx context.Context) error Collection(name string, opts ...*CollectionOptions) Collection UseSession(ctx context.Context, fn func(SessionContext) error) error UseSessionWithOptions(ctx context.Context, opts *options.SessionOptions, fn func(SessionContext) error) error StartSession(opts ...*SessionOptions) (Session, error) BeginTx(ctx context.Context, opts ...*TransactionOptions) (Tx, error) Watch(ctx context.Context, pipeline interface{}, opts ...*options.ChangeStreamOptions) (*ChangeStream, error) }
type DatabaseOptions ¶
type DatabaseOptions = options.DatabaseOptions
func NewDatabaseOptions ¶
func NewDatabaseOptions() *DatabaseOptions
type Decimal128 ¶
type Decimal128 = primitive.Decimal128
func NewDecimal128 ¶
func NewDecimal128(h, l uint64) Decimal128
type DeleteManyModel ¶
type DeleteManyModel = mongo.DeleteManyModel
func NewDeleteManyModel ¶
func NewDeleteManyModel() *DeleteManyModel
type DeleteOneModel ¶
type DeleteOneModel = mongo.DeleteOneModel
func NewDeleteOneModel ¶
func NewDeleteOneModel() *DeleteOneModel
type DeleteOptions ¶
type DeleteOptions = options.DeleteOptions
func NewDeleteOptions ¶
func NewDeleteOptions() *DeleteOptions
type DeleteResult ¶
type DeleteResult = mongo.DeleteResult
type DocumentKey ¶ added in v0.0.12
type DocumentKey struct {
Id string `bson:"_id"`
}
type FindDelete ¶
type FindDelete interface { Collation(c *Collation) FindDelete MaxTime(d time.Duration) FindDelete Project(projection interface{}) FindDelete Sort(fields ...string) FindDelete Hint(hint interface{}) FindDelete Apply(result interface{}) error }
type FindReplace ¶
type FindReplace interface { BypassDocumentValidation(b bool) FindReplace Collation(c *Collation) FindReplace MaxTime(d time.Duration) FindReplace Project(projection interface{}) FindReplace ReturnDocument(rd ReturnDocument) FindReplace Sort(fields ...string) FindReplace Upsert(b bool) FindReplace Hint(hint interface{}) FindReplace Apply(result interface{}) error }
type FindUpdate ¶
type FindUpdate interface { ArrayFilters(filters ArrayFilters) FindUpdate BypassDocumentValidation(b bool) FindUpdate Collation(c *Collation) FindUpdate MaxTime(d time.Duration) FindUpdate Project(projection interface{}) FindUpdate ReturnDocument(rd ReturnDocument) FindUpdate Sort(fields ...string) FindUpdate Upsert(b bool) FindUpdate Hint(hint interface{}) FindUpdate Apply(result interface{}) error }
type FullDocument ¶
type FullDocument = options.FullDocument
type IndexOptions ¶
type IndexOptions = options.IndexOptions
func NewIndexOptions ¶
func NewIndexOptions() *IndexOptions
type IndexView ¶
type IndexView interface { IndexView() mongo.IndexView Create(ctx context.Context, keys []string, opts *IndexOptions) (string, error) CreateIndex(ctx context.Context, name string, keys []string) (string, error) CreateUniqueIndex(ctx context.Context, name string, keys []string) (string, error) CreateTTLIndex(ctx context.Context, name string, keys []string, ttl int32) (string, error) DropIndex(ctx context.Context, keys []string) error Drop(ctx context.Context, name string) error DropAll(ctx context.Context) error }
type InsertManyOptions ¶
type InsertManyOptions = options.InsertManyOptions
func NewInsertManyOptions ¶
func NewInsertManyOptions() *InsertManyOptions
type InsertManyResult ¶
type InsertManyResult = mongo.InsertManyResult
type InsertOneModel ¶
type InsertOneModel = mongo.InsertOneModel
func NewInsertOneModel ¶
func NewInsertOneModel() *InsertOneModel
type InsertOneOptions ¶
type InsertOneOptions = options.InsertOneOptions
func NewInsertOneOptions ¶
func NewInsertOneOptions() *InsertOneOptions
type InsertOneResult ¶
type InsertOneResult = mongo.InsertOneResult
type ObjectId ¶
func MustObjectId ¶
func NewObjectId ¶
func NewObjectId() ObjectId
func NewObjectIdFromTime ¶
func ObjectIdFromHex ¶
type OperationType ¶
type OperationType string
type Query ¶
type Query interface { BatchSize(n int32) Query Hint(hint interface{}) Query Limit(n int64) Query Project(projection interface{}) Query Select(projection interface{}) Query Skip(n int64) Query Sort(fields ...string) Query AllowDiskUse(b bool) Query AllowPartialResults(b bool) Query Collation(c *Collation) Query Comment(s string) Query CursorType(cursorType CursorType) Query Max(m interface{}) Query MaxAwaitTime(d time.Duration) Query MaxTime(d time.Duration) Query Min(m interface{}) Query NoCursorTimeout(b bool) Query ReturnKey(b bool) Query ShowRecordId(b bool) Query One(result interface{}) error All(result interface{}) error Count() (int64, error) Cursor() Cursor }
type ReplaceOneModel ¶
type ReplaceOneModel = mongo.ReplaceOneModel
func NewReplaceOneModel ¶
func NewReplaceOneModel() *ReplaceOneModel
type ReplaceOptions ¶
type ReplaceOptions = options.ReplaceOptions
func NewReplaceOptions ¶
func NewReplaceOptions() *ReplaceOptions
type ReturnDocument ¶
type ReturnDocument = options.ReturnDocument
type SessionContext ¶
type SessionContext = mongo.SessionContext
type SessionOptions ¶
type SessionOptions = options.SessionOptions
func NewSessionOptions ¶
func NewSessionOptions() *SessionOptions
type TransactionOptions ¶
type TransactionOptions = options.TransactionOptions
func NewTransactionOptions ¶
func NewTransactionOptions() *TransactionOptions
type UpdateManyModel ¶
type UpdateManyModel = mongo.UpdateManyModel
func NewUpdateManyModel ¶
func NewUpdateManyModel() *UpdateManyModel
type UpdateOneModel ¶
type UpdateOneModel = mongo.UpdateOneModel
func NewUpdateOneModel ¶
func NewUpdateOneModel() *UpdateOneModel
type UpdateOptions ¶
type UpdateOptions = options.UpdateOptions
func NewUpdateOptions ¶
func NewUpdateOptions() *UpdateOptions
type UpdateResult ¶
type UpdateResult = mongo.UpdateResult
type WriteModel ¶
type WriteModel = mongo.WriteModel
Source Files ¶
Click to show internal directories.
Click to hide internal directories.