package
3.8.0
Repository: https://github.com/onsdigital/dp-mongodb.git
Documentation: pkg.go.dev

# README

Mongo Driver

This library is intended to be an abstraction that can encapsulate the mongo db and the document db operations. All functionality that accesses the db is intended to be accessed via this library. The library is responsible for connection handling as well as querying.

# Functions

No description provided by the author
No description provided by the author
NewCollection creates a new collection.
No description provided by the author
No description provided by the author
WithLastUpdatedUpdate adds last_updated to updateDoc.
WithNamespacedLastUpdatedUpdate adds unique timestamp to updateDoc.
WithNamespacedUniqueTimestampQuery adds unique timestamps to queryDoc sub-docs.
WithNamespacedUniqueTimestampUpdate adds unique timestamp to updateDoc.
WithNamespacedUpdates adds all timestamps to updateDoc.
WithUniqueTimestampQuery adds unique timestamp to queryDoc.
WithUniqueTimestampUpdate adds unique timestamp to updateDoc.
WithUpdates adds all timestamps to updateDoc.

# Constants

keep these in sync with Timestamps tags below.
keep these in sync with Timestamps tags below.

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

Collection is a handle to a MongoDB collection.
CollectionDeleteResult is the result type returned from Delete, DeleteById and DeleteMany operations.
CollectionInsertManyResult is the result type returned from InsertMany operations.
CollectionInsertResult is the result type return from Insert.
CollectionUpdateResult is the result type returned from Update, UpdateById, Upsert and UpsertById operations.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Timestamps represent an object containing time stamps keep these in sync with above const.
TLSConnectionConfig supplies the options for setting up a TLS based connection to the Mongo DB server If the Mongo server certificate is to be validated (a major security breach not doing so), the VerifyCert should be true, and the chain of CA certificates for the validation must be supplied If the connection to the server is being made with an IP address, or via an SSH proxy (such as with `dp ssh develop publishing 1 -p local-port:remote-host:remote-port`) the real hostname should be supplied in the RealHostnameForSSH attribute.

# Interfaces

No description provided by the author
Graceful represents an interface to the shutdown method.
No description provided by the author

# Type aliases

No description provided by the author
TransactionFunc is the type signature of a client function that is to be executed within a transaction, defined by the transaction context provided as the parameter to the function - transactionCtx All calls to the mongodb library to be executed within the transaction must be passed the transactionCtx Returning an error from the function indicates the transaction is to be aborted.