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

# README

Mongo Driver

This intended to be an abstraction that can encapsulate the mongo db and the document db operations. All the functionalities are supposed to be done via a common interface.
This interface is responsible for connection handling as well as the querying.

Running tests

Env Setup

test user is expected to be configured with access to testDb containing testCollection.

Against MongoDB

Bring up the mongodb test instance for testing the mongo db suite.

Against DocumentDB

Forward the documentDb cluster to local and then run the test suites. This does not work against the document db instance being forwarded.

dp ssh develop publishing 4 -- -L 27017:<document-db-cluster-url>:27017

# Functions

returns true if a remove operation has remove at least one record.
returns true if a update operation updated or upserted a record.
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
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.

# Structs

No description provided by the author
No description provided by the author
CollectionInsertOneResult is the result type return from InsertOne.
CollectionInsertResult is the result type returned from Insert.
CollectionUpdateResult is the result type returned from UpdateOne, UpdateMany, and ReplaceOne operations.
CreateAggreateCursor creates a cursor used with aggregation.
CreateFindCursor creates a find cursor.
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
No description provided by the author
Timestamps represent an object containing time stamps keep these in sync with above const.

# Interfaces

CreateCursor interface to create a unique cursor.
Graceful represents an interface to the shutdown method.
No description provided by the author