transform

package
v0.0.0-...-0672106 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteExtraProperties

func DeleteExtraProperties(doc map[string]interface{},
	ps *util.PartialSchema) (int, error)

DeleteExtraProperties will delete any properties that are not present within the given PartialSchema.

It returns an error, as well as the number of properties that were deleted from the document.

func JSONToMongo

func JSONToMongo(doc map[string]interface{}) error

JSONToMongo runs the transforms that should be necessary to take a document from a JSON file to MongoDB.

func MongoDateToString

func MongoDateToString(doc map[string]interface{}) error

MongoDateToString converts the date values in the document from MongoDB dates (Unix timestamp) to timezone-free ISO8601 dates in UTC. This is the format of date expected by Solr, and is still standards-compliant.

func MongoToSolr

func MongoToSolr(doc map[string]interface{},
	ps *util.PartialSchema) (int, error)

MongoToSolr runs the transforms that should be necessary to take a document retrieved from MongoDB to Solr. Returns the number of fields that were removed from the document.

func StringToGoDate

func StringToGoDate(doc map[string]interface{}) error

StringToGoDate converts the date values in the document from RFC3339 strings to Go time.Time objects. These will be serialized correctly as MongoDB datetime primitives when they are sent across to MongoDB.

Types

This section is empty.

Jump to

Keyboard shortcuts

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