mongodb

package
v0.0.0-...-9cc5eaa Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DB_WRITE_THRESHOLD = 100 // the threshold at which the cache is written to Mongo.

Variables

This section is empty.

Functions

func CloseMongoConnection

func CloseMongoConnection(collection string)

func InitMongoConnection

func InitMongoConnection()

func ListCollections

func ListCollections() []string

func ReadAll

func ReadAll(SearchElement string, collection string) *mongo.Cursor

Reads all of though data points of a particular type. E.g magheading or boatspeed etc

func WriteToMongo

func WriteToMongo(v []byte, collection string)

Types

type DbWriteCache_t

type DbWriteCache_t struct {
	Count int                         //number of documents waiting to be written
	Mem   *[DB_WRITE_THRESHOLD][]byte //pomter to array of []byte where the bson documents are cached before they are written
}

Jump to

Keyboard shortcuts

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