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 ¶
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 ¶
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. |
Click to show internal directories.
Click to hide internal directories.