There are 250 edges but not being able to get more than 100 edges in result when using for loop or ForEach


#1

There are 250 edges but not being able to get more than 100 edges in result when using for loop or ForEach(). But when I use All() , I am able to get all 250 edges.

var arr = g.V("<1>").Out().ToArray();
g.Emit(arr.length);

for(var i = 0; i<arr.length; i++ ){
g.Emit(arr[i]);
}

{
“result”: [
250,
"<2>",
"<3>",
"<4>",
"<5>",
"<6>",
"<7>",
"<8>",
"<9>",
"<10>",

"<96>",
"<97>",
"<98>",
"<99>",
"<100>"
]
}

g.V("<1>").Out().All()

{
“result”: [
{
“id”: “<2>”
},
{
“id”: “<3>”
},
{
“id”: “<4>”
},
{
“id”: “<5>”
},

{
“id”: “<246>”
},
{
“id”: “<247>”
},
{
“id”: “<248>”
},
{
“id”: “<249>”
},
{
“id”: “<250>”
},
{
“id”: “<251>”
}
]
}

g.V("<1>").Out().ForEach(function(v){
g.Emit(v);
})

{
“result”: [
{
“id”: “<2>”
},
{
“id”: “<3>”
},
{
“id”: “<4>”
},
{
“id”: “<5>”
},

{
“id”: “<95>”
},
{
“id”: “<96>”
},
{
“id”: “<97>”
},
{
“id”: “<98>”
},
{
“id”: “<99>”
},
{
“id”: “<100>”
},
{
“id”: “<101>”
}
]
}


#2

Haven’t used this for a while but I remember something with a default limit of 100 to prevent things blowing up :slight_smile: So maybe you can try to add a .Limit(600) to see if that makes any difference. I guess it should be placed after the Out(). I don’t have the time to test this now. So please let me know if it works or doesn’t work.


Is ForEach function has limit?
#3

Fixed upstream, See #718 for details.