Replies: 6 comments
-
Any thoughts from your end on this? |
Beta Was this translation helpful? Give feedback.
-
I'm afraid I don't comprehend what you are proposing. What's the corresponding raw Gremlin query that you are trying to match in ExRam.Gremlinq? |
Beta Was this translation helpful? Give feedback.
-
Issue 1: removing a specific value from an array property: Issue 2: replacing a property - you have an internal method |
Beta Was this translation helpful? Give feedback.
-
I don't see a As for the second proposal: The behaviour you're observing is that list properties are added to the already existing ones, right? The problem with a potential "ReplaceProperty" method is that for non-list-properties, everything is a replace. So at this time I'd suggest creating an extension method in your project. I'd have to think more about this though. |
Beta Was this translation helpful? Give feedback.
-
Hi Daniel, let me explain my use case a bit better: For each Vertex I have an Update-Request object which has the same properties as the Vertex, but all of them are nullable. To avoid having to write the if/then logic for each Property in each Vertex, I have created a reflection-based handler, which extends the query for each property that changes. It also logs the changes.
I can change the value of the property by passing the property-name instead of an expression, but I cannot DROP the property, if the value has been set to NULL on the Update-Request. |
Beta Was this translation helpful? Give feedback.
-
Two questions:
How? Can you post a snippet?
What happens if you pass null as updated value? It should work. |
Beta Was this translation helpful? Give feedback.
-
Hi Daniel,
I appreciate that ExRam.Gremlinq is a linq wrapper for gremlin and as such manipulating properties in a typed manner is the essence of what you're providing.
My need to be able to add, replace and remove values to properties in a non-typed/expression way is because I would like to automate updating DB entities from an internal state-object which only carries properties which need to be changed. I use reflection to find the corresponding property and value-type on the vertex and then I add the respective manipulation method to the query.
For "single" properties this is already supported by using
ExRam.Gremlinq.Core.IElementGremlinQueryBaseRec[TSelf].Property
. But for properties with a value-array the mentioned method only supports theAdd to list
aspect. ForReplace list
I use the private methodExRam.Gremlinq.Core.GremlinQuery<TElement,TOutVertex,TInVertex,TScalar,TMeta,TFoldedQuery>.DropProperties
, but forRemove from list
I found no method at all.Would it make sense to make your private
DropProperties
public and provide a similar method ie.DropPropertiesByValue
? Or do you suggest to go a different route?thanks! Tilli
Beta Was this translation helpful? Give feedback.
All reactions