mongods

package module
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2021 License: MIT Imports: 15 Imported by: 8 modules, 11 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

go-ds-mongo

Made by Textile Chat on Slack GitHub license Go Report Card GitHub action

A MongoDB go-datastore implementation

Table of Contents

Overview

https://godoc.org/github.com/textileio/go-ds-mongo

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBatchAlreadyCommited = errors.New("batch already commited")
)
View Source
var (
	ErrClosed = errors.New("datastore was closed")
)
View Source
var (
	ErrTxnFinalized = errors.New("txn was already finalized")
)

Functions

This section is empty.

Types

type MongoDS

type MongoDS struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, uri string, dbName string, opts ...Option) (*MongoDS, error)

func (*MongoDS) Batch

func (m *MongoDS) Batch() (datastore.Batch, error)

func (*MongoDS) Close

func (m *MongoDS) Close() error

func (*MongoDS) Delete

func (m *MongoDS) Delete(key datastore.Key) error

func (*MongoDS) Get

func (m *MongoDS) Get(key datastore.Key) ([]byte, error)

func (*MongoDS) GetSize

func (m *MongoDS) GetSize(key datastore.Key) (int, error)

func (*MongoDS) Has

func (m *MongoDS) Has(key datastore.Key) (bool, error)

func (*MongoDS) NewTransaction

func (m *MongoDS) NewTransaction(readOnly bool) (datastore.Txn, error)

func (*MongoDS) NewTransactionExtended added in v0.1.3

func (m *MongoDS) NewTransactionExtended(readOnly bool) (dsextensions.TxnExt, error)

func (*MongoDS) Put

func (m *MongoDS) Put(key datastore.Key, val []byte) error

func (*MongoDS) Query

func (m *MongoDS) Query(q query.Query) (query.Results, error)

func (*MongoDS) QueryExtended

func (m *MongoDS) QueryExtended(q dsextensions.QueryExt) (query.Results, error)

func (*MongoDS) Sync

func (m *MongoDS) Sync(datastore.Key) error

type Option

type Option func(*config)

func WithCollName

func WithCollName(collName string) Option

func WithOpTimeout

func WithOpTimeout(d time.Duration) Option

func WithTxnTimeout

func WithTxnTimeout(d time.Duration) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址