Versions in this module Expand all Collapse all v0 v0.1.1 Feb 11, 2024 Changes in this version + const DefaultIndexName + const ReservedPrefix + func ErrorCodeIs(err error, code ErrorCode, codes ...ErrorCode) bool + type Backend interface + Close func() + Database func(string) (Database, error) + DropDatabase func(context.Context, *DropDatabaseParams) error + ListDatabases func(context.Context, *ListDatabasesParams) (*ListDatabasesResult, error) + Status func(context.Context, *StatusParams) (*StatusResult, error) + func BackendContract(b Backend) Backend + type Collection interface + Compact func(context.Context, *CompactParams) (*CompactResult, error) + CreateIndexes func(context.Context, *CreateIndexesParams) (*CreateIndexesResult, error) + DeleteAll func(context.Context, *DeleteAllParams) (*DeleteAllResult, error) + DropIndexes func(context.Context, *DropIndexesParams) (*DropIndexesResult, error) + Explain func(context.Context, *ExplainParams) (*ExplainResult, error) + InsertAll func(context.Context, *InsertAllParams) (*InsertAllResult, error) + ListIndexes func(context.Context, *ListIndexesParams) (*ListIndexesResult, error) + Query func(context.Context, *QueryParams) (*QueryResult, error) + Stats func(context.Context, *CollectionStatsParams) (*CollectionStatsResult, error) + UpdateAll func(context.Context, *UpdateAllParams) (*UpdateAllResult, error) + func CollectionContract(c Collection) Collection + type CollectionInfo struct + CappedDocuments int64 + CappedSize int64 + Name string + UUID string + func (ci *CollectionInfo) Capped() bool + type CollectionStatsParams struct + Refresh bool + type CollectionStatsResult struct + CountDocuments int64 + IndexSizes []IndexSize + SizeCollection int64 + SizeFreeStorage int64 + SizeIndexes int64 + SizeTotal int64 + type CompactParams struct + Full bool + type CompactResult struct + type CreateCollectionParams struct + CappedDocuments int64 + CappedSize int64 + Name string + func (ccp *CreateCollectionParams) Capped() bool + type CreateIndexesParams struct + Indexes []IndexInfo + type CreateIndexesResult struct + type Database interface + Collection func(string) (Collection, error) + CreateCollection func(context.Context, *CreateCollectionParams) error + DropCollection func(context.Context, *DropCollectionParams) error + ListCollections func(context.Context, *ListCollectionsParams) (*ListCollectionsResult, error) + RenameCollection func(context.Context, *RenameCollectionParams) error + Stats func(context.Context, *DatabaseStatsParams) (*DatabaseStatsResult, error) + func DatabaseContract(db Database) Database + type DatabaseInfo struct + Name string + type DatabaseStatsParams struct + Refresh bool + type DatabaseStatsResult struct + CountDocuments int64 + SizeCollections int64 + SizeFreeStorage int64 + SizeIndexes int64 + SizeTotal int64 + type DeleteAllParams struct + IDs []any + RecordIDs []int64 + type DeleteAllResult struct + Deleted int32 + type DropCollectionParams struct + Name string + type DropDatabaseParams struct + Name string + type DropIndexesParams struct + Indexes []string + type DropIndexesResult struct + type Error struct + func NewError(code ErrorCode, err error) *Error + func (err *Error) Code() ErrorCode + func (err *Error) Error() string + type ErrorCode int + const ErrorCodeCollectionAlreadyExists + const ErrorCodeCollectionDoesNotExist + const ErrorCodeCollectionNameIsInvalid + const ErrorCodeDatabaseDoesNotExist + const ErrorCodeDatabaseNameIsInvalid + const ErrorCodeInsertDuplicateID + func (i ErrorCode) String() string + type ExplainParams struct + Filter *types.Document + Limit int64 + Sort *types.Document + type ExplainResult struct + FilterPushdown bool + LimitPushdown bool + QueryPlanner *types.Document + SortPushdown bool + type IndexInfo struct + Key []IndexKeyPair + Name string + Unique bool + type IndexKeyPair struct + Descending bool + Field string + type IndexSize struct + Name string + Size int64 + type InsertAllParams struct + Docs []*types.Document + type InsertAllResult struct + type ListCollectionsParams struct + Name string + type ListCollectionsResult struct + Collections []CollectionInfo + type ListDatabasesParams struct + Name string + type ListDatabasesResult struct + Databases []DatabaseInfo + type ListIndexesParams struct + type ListIndexesResult struct + Indexes []IndexInfo + type QueryParams struct + Comment string + Filter *types.Document + Limit int64 + OnlyRecordIDs bool + Sort *types.Document + type QueryResult struct + Iter types.DocumentsIterator + type RenameCollectionParams struct + NewName string + OldName string + type StatusParams struct + type StatusResult struct + CountCappedCollections int32 + CountCollections int64 + type UpdateAllParams struct + Docs []*types.Document + type UpdateAllResult struct + Updated int32 v0.1.0 Feb 11, 2024