mongodb

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: Apache-2.0 Imports: 18 Imported by: 3 modules, 5 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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Key   string      `bson:"_id"`
	Value interface{} `bson:"value"`
	Etag  string      `bson:"_etag"`
}

Item is Mongodb document wrapper.

type MongoDB

type MongoDB struct {
	state.DefaultBulkStore
	// contains filtered or unexported fields
}

MongoDB is a state store implementation for MongoDB.

func NewMongoDB

func NewMongoDB(logger logger.Logger) *MongoDB

NewMongoDB returns a new MongoDB state store.

func (*MongoDB) Delete

func (m *MongoDB) Delete(req *state.DeleteRequest) error

Delete performs a delete operation.

func (*MongoDB) Features added in v1.1.1

func (m *MongoDB) Features() []state.Feature

Features returns the features available in this state store.

func (*MongoDB) Get

func (m *MongoDB) Get(req *state.GetRequest) (*state.GetResponse, error)

Get retrieves state from MongoDB with a key.

func (*MongoDB) Init

func (m *MongoDB) Init(metadata state.Metadata) error

Init establishes connection to the store based on the metadata.

func (*MongoDB) Multi

func (m *MongoDB) Multi(request *state.TransactionalStateRequest) error

Multi performs a transactional operation. succeeds only if all operations succeed, and fails if one or more operations fail.

func (*MongoDB) Ping added in v1.4.4

func (m *MongoDB) Ping() error

func (*MongoDB) Query added in v1.5.0

func (m *MongoDB) Query(req *state.QueryRequest) (*state.QueryResponse, error)

Query executes a query against store.

func (*MongoDB) Set

func (m *MongoDB) Set(req *state.SetRequest) error

Set saves state into MongoDB.

type Query added in v1.5.0

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

func (*Query) Finalize added in v1.5.0

func (q *Query) Finalize(filters string, qq *query.Query) error

func (*Query) VisitAND added in v1.5.0

func (q *Query) VisitAND(f *query.AND) (string, error)

func (*Query) VisitEQ added in v1.5.0

func (q *Query) VisitEQ(f *query.EQ) (string, error)

func (*Query) VisitIN added in v1.5.0

func (q *Query) VisitIN(f *query.IN) (string, error)

func (*Query) VisitOR added in v1.5.0

func (q *Query) VisitOR(f *query.OR) (string, error)

Jump to

Keyboard shortcuts

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