Documentation
¶
Index ¶
- func DeleteExtraProperties(doc map[string]interface{}, ps *util.PartialSchema) (int, error)
- func JSONToMongo(doc map[string]interface{}) error
- func MongoDateToString(doc map[string]interface{}) error
- func MongoToSolr(doc map[string]interface{}, ps *util.PartialSchema) (int, error)
- func StringToGoDate(doc map[string]interface{}) error
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 ¶
JSONToMongo runs the transforms that should be necessary to take a document from a JSON file to MongoDB.
func MongoDateToString ¶
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 ¶
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.