Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gizmo: accumulate results in map() #49

Closed
jasondouglas opened this issue Jul 3, 2014 · 4 comments
Closed

Gizmo: accumulate results in map() #49

jasondouglas opened this issue Jul 3, 2014 · 4 comments

Comments

@jasondouglas
Copy link

jasondouglas commented Jul 3, 2014

Other finals seem to work fine. For example this works:

g.Emit({
    "films" : g.V().Has("/film/film/directed_by", director_id).TagArray()
});

But this gets: {"error" : "(anonymous): Line 6:1 Unexpected token } (and 3 more errors)"}

g.Emit({
    "films" : g.V().Has("/film/film/directed_by", director_id).ForEach(function(d){
      return d;
    });
});

... or any other variation of function body (like a nested g.Emit());

You might wonder what I'm trying to do... it's format an entire tree. g.Emit() seems to be the only way to do optional fields in an object, so I was trying to figure out how to nest that.

@barakmich barakmich added the bug label Jul 31, 2014
@barakmich
Copy link
Member

This is a bug in the Emit function I think, combined with not accumulating the return values on ForEach (where not undefined), which is straightforward enough.

@dennwc
Copy link
Member

dennwc commented Jul 9, 2016

There is no error on HEAD for first example.
Will implement accumulation a bit later.

@dennwc dennwc self-assigned this Jul 9, 2016
@robertmeta robertmeta added this to the Eventually? milestone Jul 27, 2016
@dennwc dennwc changed the title Syntax error when nesting ForEach() in g.Emit()? gizmo: accumulate results in ForEach Jan 11, 2017
@iddan
Copy link
Collaborator

iddan commented Sep 20, 2019

Correction: .forEach() shouldn't accumulate results, .map() should.

@iddan iddan changed the title gizmo: accumulate results in ForEach gizmo: accumulate results in map() Oct 6, 2019
@iddan iddan changed the title gizmo: accumulate results in map() Gizmo: accumulate results in map() Oct 12, 2019
@iddan
Copy link
Collaborator

iddan commented Dec 15, 2019

Closing this as #878 will not include steps that accept a function.

@iddan iddan closed this as completed Dec 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants