# Result

<div class="jsdoc-content"><header>
    
        <h2><span class="attribs"><span class="type-signature"></span></span>
            <span class="ancestors"><a href="index.html">mapping</a>~</span>Result<span class="signature">(rs, info, rowAdapter)</span><span class="type-signature"></span></h2>
        
            <div class="class-description"><p>Represents the result of an execution as an iterable of objects in the Mapper.</p></div>
        
    
</header>


    
        

    
    </div>

## Constructor

<div class="jsdoc-content">
    

    
    <h4 class="name" id="Result"><span class="type-signature"></span>new Result<span class="signature">(rs, info, rowAdapter)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Creates a new instance of Result.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params docutils align-default">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>rs</code></td>
            

            <td class="type">
            
                
<span class="param-type">ResultSet</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>info</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="ModelMappingInfo.html">ModelMappingInfo</a></span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>rowAdapter</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/mapping/result.js#L12" target="_blank" rel="noopener">mapping/result.js, line 12</a></p></div>




















    
    

    

    

    

    

    

    

    
        </div>

## Members

<div class="jsdoc-content">

        
            
<h4 class="name" id="length"><span class="type-signature"></span>length<span class="type-signature"> :Number</span></h4>




<div class="description">
    <p>Gets the amount of the documents contained in this Result instance.</p>
<p>When the results are paged, it returns the length of the current paged results not the total amount of
rows in the table matching the query.</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">Number</span>


        </li>
    </ul>





<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/mapping/result.js#L46" target="_blank" rel="noopener">mapping/result.js, line 46</a></p></div>






        
            
<h4 class="name" id="pageState"><span class="type-signature"></span>pageState<span class="type-signature"> :String</span></h4>




<div class="description">
    <p>A string token representing the current page state of query.</p>
<p>When provided, it can be used in the following executions to continue paging and retrieve the remained of the
result for the query.</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">String</span>


        </li>
    </ul>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-default">Default Value:</dt>
    <dd class="tag-default"><ul class="dummy">
            <li>null</li>
        </ul></dd>
    

    
    
    

    

    

    
</dl><div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/mapping/result.js#L56" target="_blank" rel="noopener">mapping/result.js, line 56</a></p></div>






        
    

    
        </div>

## Methods

<div class="jsdoc-content">

        
            

    

    
    <h4 class="name" id="Symbol.iterator"><span class="type-signature">(generator) </span>Symbol.iterator<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Returns a new Iterator object that contains the document values.</p>
</div>













<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/mapping/result.js#L85" target="_blank" rel="noopener">mapping/result.js, line 85</a></p></div>




















        
            

    

    
    <h4 class="name" id="first"><span class="type-signature"></span>first<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Gets the first document in this result or null when the result is empty.</p>
</div>













<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/mapping/result.js#L75" target="_blank" rel="noopener">mapping/result.js, line 75</a></p></div>




















        
            

    

    
    <h4 class="name" id="forEach"><span class="type-signature"></span>forEach<span class="signature">(callback, thisArg<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Executes a provided function once per result element.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params docutils align-default">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>Function to execute for each element, taking two arguments: currentValue and index.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>thisArg</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Value to use as <code>this</code> when executing callback.</p></td>
        </tr>

    
    </tbody>
</table>






<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/mapping/result.js#L113" target="_blank" rel="noopener">mapping/result.js, line 113</a></p></div>




















        
            

    

    
    <h4 class="name" id="toArray"><span class="type-signature"></span>toArray<span class="signature">()</span><span class="type-signature"> &rarr; {Array&lt;Object>}</span></h4>
    

    



<div class="description">
    <p>Converts the current instance to an Array of documents.</p>
</div>













<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/mapping/result.js#L100" target="_blank" rel="noopener">mapping/result.js, line 100</a></p></div>















<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Array&lt;Object></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="wasApplied"><span class="type-signature"></span>wasApplied<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>When this instance is the result of a conditional update query, it returns whether it was successful.
Otherwise, it returns <code>true</code>.</p>
<p>For consistency, this method always returns <code>true</code> for non-conditional queries (although there is
no reason to call the method in that case). This is also the case for conditional DDL statements
(CREATE KEYSPACE... IF NOT EXISTS, CREATE TABLE... IF NOT EXISTS), for which the server doesn't return
information whether it was applied or not.</p>
</div>













<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/mapping/result.js#L68" target="_blank" rel="noopener">mapping/result.js, line 68</a></p></div></div>
