mongo-drivergo.mongodb.org/mongo-driver/core/readconcern Index | Files

package readconcern

import "go.mongodb.org/mongo-driver/core/readconcern"

Index

Types

type Option

type Option func(concern *ReadConcern)

Option is an option to provide when creating a ReadConcern.

func Level

func Level(level string) Option

Level creates an option that sets the level of a ReadConcern.

type ReadConcern

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

ReadConcern for replica sets and replica set shards determines which data to return from a query.

func Linearizable

func Linearizable() *ReadConcern

Linearizable specifies that the query should return data that reflects all successful writes issued with a write concern of "majority" and acknowledged prior to the start of the read operation.

func Local

func Local() *ReadConcern

Local specifies that the query should return the instance’s most recent data.

func Majority

func Majority() *ReadConcern

Majority specifies that the query should return the instance’s most recent data acknowledged as having been written to a majority of members in the replica set.

func New

func New(options ...Option) *ReadConcern

New constructs a new read concern from the given string.

func (*ReadConcern) MarshalBSONElement

func (rc *ReadConcern) MarshalBSONElement() (*bson.Element, error)

MarshalBSONElement implements the bson.ElementMarshaler interface.

Source Files

readconcern.go

Version
v0.0.6
Published
May 31, 2018
Platform
linux/amd64
Imports
1 packages
Last checked
12 seconds ago

Tools for package owners.