expand

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 27, 2017 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package expand represents expand stage of analysis. Expand stage expands documents to value (result: [name, type] => value). Individual fields in this stage lose their link to the original document that allows analyzing all values of some field in next stages.

Index

Constants

This section is empty.

Variables

View Source
var (
	BsonNested    = "_"
	BsonFieldName string
	BsonFieldType string
	BsonLevel     string
	BsonLength    string
	BsonValue     string
)

Abbreviations for aggregation pipeline.

Functions

func ToValueChannel

func ToValueChannel(input interface{}, concurrency int, bufferSize int) chan Value

ToValueChannel converts input channel to Value channel. The input may by raw []byte channel or Value channel (no conversion).

func ValueChannelToSlice

func ValueChannelToSlice(ch chan Value) []interface{}

ValueChannelToSlice reads values from Value channel into slice.

Types

type Options

type Options struct {
	StringMaxLength   uint // strings will be truncated to this length, this setting does not affect the processing of length
	ArrayMaxLength    uint // array will be truncated to the first N items, this setting does not affect the processing of length
	MaxDepth          uint // analysis will be proceed to the desired depth, zero means that only root fields will be processed
	StoreValue        bool // storing of value enables detailed analysis in next stages
	StoreStringLength bool // store string length (before truncation)
	StoreArrayLength  bool // store array length (before shortening)
	StoreObjectLength bool // store number of object fields
}

Options for expand stage.

type StageFactory

type StageFactory func(expandOptions *Options) *analysis.Stage

StageFactory prototype.

type Value

type Value struct {
	Name   string      `bson:"n"` // name of field
	Type   string      `bson:"t"` // type of field
	Level  uint        `bson:"e"` // level of nested field, root level is zero
	Length uint        `bson:"l"` // length of value, it is available for some types (if enabled in options)
	Value  interface{} `bson:"v"` // value of field (if enabled in options)
}

Value of field with given name and type

Directories

Path Synopsis
Package expandInDBCommon contains common functions for expandInDBDepth and expandInDBSeq packages.
Package expandInDBCommon contains common functions for expandInDBDepth and expandInDBSeq packages.
Package expandInDBDepth is the implementation of the expand stage that runs in database.
Package expandInDBDepth is the implementation of the expand stage that runs in database.
Package expandInDBSeq is the implementation of the expand stage that runs in database.
Package expandInDBSeq is the implementation of the expand stage that runs in database.
Package expandLocally is the implementation of the expand stage that runs locally.
Package expandLocally is the implementation of the expand stage that runs locally.
Package expandTests contains common tests for expand stage.
Package expandTests contains common tests for expand stage.

Jump to

Keyboard shortcuts

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