package writeconcern
import "go.mongodb.org/mongo-driver/core/writeconcern"
Index ¶
- Variables
- type Option
- func J(j bool) Option
- func W(w int) Option
- func WMajority() Option
- func WTagSet(tag string) Option
- func WTimeout(d time.Duration) Option
- type WriteConcern
Variables ¶
ErrInconsistent indicates that an inconsistent write concern was specified.
ErrNegativeW indicates that a negative integer `w` field was specified.
ErrNegativeWTimeout indicates that a negative WTimeout was specified.
Types ¶
type Option ¶
type Option func(concern *WriteConcern)
Option is an option to provide when creating a ReadConcern.
func J ¶
J requests acknowledgement from MongoDB that write operations are written to the journal.
func W ¶
W requests acknowledgement that write operations propagate to the specified number of mongod instances.
func WMajority ¶
func WMajority() Option
WMajority requests acknowledgement that write operations propagate to the majority of mongod instances.
func WTagSet ¶
WTagSet requests acknowledgement that write operations propagate to the specified mongod instance.
func WTimeout ¶
WTimeout specifies specifies a time limit for the write concern.
type WriteConcern ¶
type WriteConcern struct {
// contains filtered or unexported fields
}
WriteConcern describes the level of acknowledgement requested from MongoDB for write operations to a standalone mongod or to replica sets or to sharded clusters.
func New ¶
func New(options ...Option) *WriteConcern
New constructs a new WriteConcern.
func (*WriteConcern) Acknowledged ¶
func (wc *WriteConcern) Acknowledged() bool
Acknowledged indicates whether or not a write with the given write concern will be acknowledged.
func (*WriteConcern) IsValid ¶
func (wc *WriteConcern) IsValid() bool
IsValid checks whether the write concern is invalid.
func (*WriteConcern) MarshalBSONElement ¶
func (wc *WriteConcern) MarshalBSONElement() (*bson.Element, error)
MarshalBSONElement marshals the write concern into a *bson.Element.
Source Files ¶
writeconcern.go
- Version
- v0.0.6
- Published
- May 31, 2018
- Platform
- windows/amd64
- Imports
- 3 packages
- Last checked
- 2 seconds ago –
Tools for package owners.