miscellaneou

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetField

func GetField[T expression.ObjectExpression](filed string, input T) miscellaneousOperator

GetField New in version 5.0. Returns the value of a specified field from a document. If you don't specify an object, $getField returns the value of the field from $$CURRENT. You can use $getField to retrieve the value of fields with names that contain periods (.) or start with dollar signs ($). $getField has the following syntax:

{
 $getField: {
   field: <String>,
   input: <Object>
 }
}

func Rand

func Rand() miscellaneousOperator

Rand New in version 4.4.2. Returns a random float between 0 and 1 each time it is called. $rand has the following syntax: { $rand: {} } The $rand operator doesn't take any arguments.

func SampleRate

func SampleRate(f float64) miscellaneousOperator

SampleRate New in version 4.4.2. Matches a random selection of input documents. The number of documents selected approximates the sample rate expressed as a percentage of the total number of documents. The $sampleRate operator has the following syntax: { $sampleRate: <non-negative float> }

Types

This section is empty.

Jump to

Keyboard shortcuts

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