Exemple #1
0
        public AggregateStage AddProjection(IDonutFunction function)
        {
            var stage = new AggregateStage(_script, function);

            Stages.Add(stage);
            return(stage);
        }
Exemple #2
0
        public AggregateStage(IDonutScript script, IDonutFunction function)
        {
            Function    = function;
            _script     = script;
            ChildStages = new List <AggregateStage>();//new AggregateJobTree(script);
            switch (function.Type)
            {
            case DonutFunctionType.Project: Type = AggregateStageType.Project; break;

            case DonutFunctionType.GroupField: Type = AggregateStageType.Group; break;
            }
        }
Exemple #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="function"></param>
        /// <param name="expParameters"></param>
        /// <returns></returns>
        public IDonutFunction GetFunction(string function)
        {
            IDonutFunction output = null;
            var            lower  = function.ToLower();

            if (Functions.ContainsKey(lower))
            {
                output = Functions[lower].Clone();
            }
            else
            {
                throw new Exception($"Unsupported js function: {function}");
            }
            return(output);
        }
Exemple #4
0
 public static DonutFunction Wrap(IDonutFunction df)
 {
     return(df as DonutFunction);
 }