protected UpdatePropertiesBaseOperator(GraphViewExecutionOperator inputOp, GraphViewConnection connection, List <Tuple <WValueExpression, WValueExpression, int> > pPropertiesToBeUpdated, UpdatePropertyMode pMode = UpdatePropertyMode.Set) : base(inputOp, connection) { PropertiesToBeUpdated = pPropertiesToBeUpdated; Mode = pMode; }
public UpdateEdgePropertiesOperator( GraphViewExecutionOperator inputOp, GraphViewConnection connection, int srcVertexIdIndex, int edgeOffsetIndex, List <Tuple <WValueExpression, WValueExpression, int> > propertiesList, UpdatePropertyMode pMode = UpdatePropertyMode.Set) : base(inputOp, connection, propertiesList, pMode) { this._srcVertexIdIndex = srcVertexIdIndex; this._edgeOffsetIndex = edgeOffsetIndex; }
private void UpdateNodeProperties( Dictionary <string, JObject> documentsMap, string vertexId, JObject vertexDocObject, List <Tuple <WValueExpression, WValueExpression, int> > propList, UpdatePropertyMode mode) { VertexField vertexField = this.Connection.VertexCache.GetVertexField(vertexId); // Drop all non-reserved properties if (propList.Count == 1 && !propList[0].Item1.SingleQuoted && propList[0].Item1.Value.Equals("*", StringComparison.OrdinalIgnoreCase) && !propList[0].Item2.SingleQuoted && propList[0].Item2.Value.Equals("null", StringComparison.OrdinalIgnoreCase)) { List <string> toBeDroppedPropertiesNames = GraphViewJsonCommand.DropAllNodeProperties(vertexDocObject); foreach (var propertyName in toBeDroppedPropertiesNames) { vertexField.VertexProperties.Remove(propertyName); } } else { foreach (var t in propList) { WValueExpression keyExpression = t.Item1; WValueExpression valueExpression = t.Item2; if (mode == UpdatePropertyMode.Set) { JProperty updatedProperty = GraphViewJsonCommand.UpdateProperty(vertexDocObject, keyExpression, valueExpression); if (updatedProperty == null) { vertexField.VertexProperties.Remove(keyExpression.Value); } else { vertexField.UpdateVertexProperty(updatedProperty.Name, updatedProperty.Value.ToString(), JsonDataTypeHelper.GetJsonDataType(updatedProperty.Value.Type)); } } else { throw new NotImplementedException(); } } } documentsMap[vertexId] = vertexDocObject; }
public UpdateNodePropertiesOperator(GraphViewExecutionOperator inputOp, GraphViewConnection connection, int pNodeIndex, List <Tuple <WValueExpression, WValueExpression, int> > pPropertiesList, UpdatePropertyMode pMode = UpdatePropertyMode.Set) : base(inputOp, connection, pPropertiesList, pMode) { _nodeIdIndex = pNodeIndex; }