                     @profile = result.profile
                     value = result.value
                 else
-                    value = result
+                    @profile = null
+                    value = result 
                 if typeof value._next is 'function' # if it's a cursor
+                    @type = 'cursor'
                     @results = []
                     @cursor = value
                     @is_feed = @cursor.toString() == '[object Feed]'
                     @missing = 0
                     @ended = false
-                    @start_index = 0
                 else
-                    @start_index = 0
+                    @type = 'value'
                     @value = value
                     @ended = true
                 @ready = true
                 @trigger 'ready', @
-
-        # Remove n elements from the result set of a cursor Waits for
-        # n+1 elements, or the end before returning
-        #
-        # Note: the callbacks are not ordered. In this code, `f` is
-        # never called: `qr.shift 2 f; cb = -> qr.shift 1 cb`
-        shift: (n, k) =>
-            cb = =>
-                if @results.length > n or @ended
-                    @off 'end', cb
-                    ret = @results[0...n]
-                    @results = @results[n...]
-                    @start_index += n
-                    k @, ret
-                else
-                    @once 'add', cb
-                    @more()
-            @once 'end', cb
-            cb()
 
         # Discard the results
         discard: =>

            @query_result = args.query_result
            if @query_events?
                for own event, handler of @query_events()
                    @query_result.on event, handler

        current_result: []
        max_datum_threshold: 1000

        # Return whether there are too many datums

                @$('.raw_view_textarea').height(height)

        render: =>
            @$el.html @template JSON.stringify @current_batch()
            return @

        add_row: (row) =>
            @render()

    class ProfileView extends ResultView
        className: 'results profile_view_container'
