GetValue() public method

public GetValue ( string name ) : BsonValue
name string
return BsonValue
Ejemplo n.º 1
0
        public override void Input(BsonDataRow inputRow)
        {
            var newRow = new BsonDataRow();

            foreach (var column in _transformColumnDefinitions)
            {
                if (column.TransformFunction != null)
                {
                    var newVal = column.TransformFunction(inputRow.GetValue(column.SourceColumnName));

                    newRow.SetValue(column.TargetColumnName, newVal);
                }
                else
                {
                    newRow.SetValue(column.TargetColumnName, inputRow.GetValue(column.SourceColumnName));
                }
            }

            foreach (var column in _calculationColumnDefinitions)
            {
                var calVal = column.CalculateFunction(inputRow);

                newRow.SetValue(column.TargetColumnName, calVal);
            }

            inputRow.CombineWith(newRow);

            Output(inputRow);
        }
Ejemplo n.º 2
0
        public override void Input(BsonDataRow inputRow)
        {
            var newRow = new BsonDataRow();

            foreach (var column in _transformColumnDefinitions)
            {
                if (column.TransformFunction != null)
                {
                    var newVal = column.TransformFunction(inputRow.GetValue(column.SourceColumnName));

                    newRow.SetValue(column.TargetColumnName, newVal);
                }
                else
                {
                    newRow.SetValue(column.TargetColumnName, inputRow.GetValue(column.SourceColumnName));
                }
            }

            foreach (var column in _calculationColumnDefinitions)
            {
                var calVal = column.CalculateFunction(inputRow);

                newRow.SetValue(column.TargetColumnName, calVal);
            }

            inputRow.CombineWith(newRow);

            Output(inputRow);
        }
Ejemplo n.º 3
0
        public void Input(BsonDataRow inputRow)
        {
            var identity = Builders<BsonDocument>.Filter.Eq("_id", inputRow.GetValue("_id"));

            UpdateDefinition<BsonDocument> updateDefinition = null;

            foreach (var columName in _columnNames)
            {
                if(updateDefinition == null)
                {
                    updateDefinition = Builders<BsonDocument>.Update.Set(columName, inputRow.GetValue(columName));
                }
                else
                {
                    updateDefinition = updateDefinition.Set(columName, inputRow.GetValue(columName));
                }
            }

            var task = _collection.UpdateOneAsync(identity, updateDefinition, new UpdateOptions { IsUpsert = true });

            task.Wait();
        }
Ejemplo n.º 4
0
        public void Input(BsonDataRow inputRow)
        {
            var identity = Builders <BsonDocument> .Filter.Eq("_id", inputRow.GetValue("_id"));

            UpdateDefinition <BsonDocument> updateDefinition = null;

            foreach (var columName in _columnNames)
            {
                if (updateDefinition == null)
                {
                    updateDefinition = Builders <BsonDocument> .Update.Set(columName, inputRow.GetValue(columName));
                }
                else
                {
                    updateDefinition = updateDefinition.Set(columName, inputRow.GetValue(columName));
                }
            }

            var task = _collection.UpdateOneAsync(identity, updateDefinition, new UpdateOptions {
                IsUpsert = true
            });

            task.Wait();
        }