             data[nodeAlias] = node.get()
           else
             data[nodeAlias] = node
-      callback data, rowId
+      callback data, rowId, @_cursor
       break if firstOnly
-    return undefined
+    return

class Neo4jCursor
  constructor: (@_cursor) ->
    @length = @_cursor.length
  @define 'cursor',
    get: -> @_cursor
    set: -> console.warn "This is not going to work, you trying to reset cursor, make new Cypher query instead"

  ###
  @locus Server
  @summary Returns array of fetched rows. If query was passed with `reactive` option - data will be updated each event loop. This method is chainable.
  @name forEach
  @class Neo4jCursor
  @returns {[Object]} - Returns array of fetched rows


  ###
  @locus Server
  @summary Iterates thought Neo4j query results. And returns data as Neo4jData, Neo4jRelationship or Neo4jNode instance (depends from Cypher query). This function will move cursor to latest item.
  @name each
  @class Neo4jCursor
  @param {Function} callback - Callback function, with `node` (as Neo4jData, Neo4jRelationship or Neo4jNode instance), `num`, `cursor` arguments
  @returns {undefined}
  ###
  each: (callback) -> 
    check callback, Function
    if @length > 0
      first = true
      while @hasNext or first
        if first
          callback @first(), @_current, @_cursor
          first = false
        else
          callback @next(), @_current, @_cursor
    return

  ###
  @locus Server
  @summary Iterates though Neo4j query results. If query was passed with `reactive` option - data will be updated each event loop.
  @name forEach
  @class Neo4jCursor
  @param {Function} callback - Callback function, with `node` (plain object), `num`, `cursor` arguments
  @returns {undefined}
  ###
  forEach: (callback, firstOnly) ->
