Array injected in first As block becomes empty in second As block.
See original GitHub issueHi, Let say I have Vertex (People)
on which I have ZipCode as one property, I have Edge (Know)
.
Now I want to get all the People who I do not know and but comes under array of ZipCode.
public class People : IVertex
{
public string ZipCode { get; set; }
public string Id { get; set; }
public string Label { get; set; }
}
var nearByZipCodes= new string[] {"10001","10199", "10121"};
var userId="";
await _g.Inject(nearByZipCodes)
.Fold()
.As((_, injectedNearByZipCode) => _
.V<People>(userId).Both<Know>()
.OfType<People>()
.Values(c=>c.Id).Fold()
.As((__, knownPeople) => __
.V<People>().Where(c =>
!knownPeople.Value.Contains(c.Id) && injectedNearByZipCode.Value.Contains(c.ZipCode)))
);
I tried the above query but injectedNearByZipCode
is empty in the second As
block.
is this expected behavior , if yes what will be proper way to write this query.
Thank you !
Version :
<PackageReference Include="ExRam.Gremlinq.Providers.CosmosDb" Version="8.0.0-preview-0294" />
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Array.first Vs Array.shift in Ruby
When you called the method injecting on the array [1,2,3] , as acc was empty, sef.shift gets invoked. Now acc is 1 ....
Read more >block.workspace.topBlocks is an empty array for all but the ...
This code assigns toolbox to the toolbox property after you've already called inject(..). What happens when you construct options immediately ...
Read more >Inject Method: Explained
Here we are passing inject an initial value of an empty array. The first element between the || will always be the 'result'...
Read more >module Enumerable - RDoc Documentation
With a block given, returns an array of two arrays: The first having those elements for which the block returns a truthy value....
Read more >module Enumerable - Documentation for Ruby 2.1.0
Returns two arrays, the first containing the elements of enum for which the block evaluates to true, the second containing the rest. If...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Beware of that caveat! Fold steps will erase your path history, including all the step labels. See here for more details on ReducingBarrierSteps. You have to keep that in mind, there’s no way Gremlinq can detect these (or is there?). A workaround is to wrap the right part of the query in a map operation:
Hi , @danielcweber Thank you, it works. I will go through the link you have provided.