"Fossies" - the Fresh Open Source Software Archive

Member "arangodb-3.4.7/Documentation/Examples/geoIndexCreateForArrayAttribute1.generated" (24 Jun 2019, 3753 Bytes) of package /linux/misc/arangodb-3.4.7.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "geoIndexCreateForArrayAttribute1.generated": 3.4.6.1_vs_3.4.7.

    1 arangosh&gt; db.geo.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"geo"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"loc"</span> ] });
    2 { 
    3   <span class="hljs-string">"bestIndexedLevel"</span> : <span class="hljs-number">17</span>, 
    4   <span class="hljs-string">"fields"</span> : [ 
    5     <span class="hljs-string">"loc"</span> 
    6   ], 
    7   <span class="hljs-string">"geoJson"</span> : <span class="hljs-literal">false</span>, 
    8   <span class="hljs-string">"id"</span> : <span class="hljs-string">"geo/119788"</span>, 
    9   <span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>, 
   10   <span class="hljs-string">"maxNumCoverCells"</span> : <span class="hljs-number">8</span>, 
   11   <span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>, 
   12   <span class="hljs-string">"type"</span> : <span class="hljs-string">"geo"</span>, 
   13   <span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>, 
   14   <span class="hljs-string">"worstIndexedLevel"</span> : <span class="hljs-number">4</span>, 
   15   <span class="hljs-string">"code"</span> : <span class="hljs-number">201</span> 
   16 }
   17 arangosh&gt; <span class="hljs-keyword">for</span> (i = <span class="hljs-number">-90</span>;  i &lt;= <span class="hljs-number">90</span>;  i += <span class="hljs-number">10</span>) {
   18 ........&gt;     <span class="hljs-keyword">for</span> (j = <span class="hljs-number">-180</span>; j &lt;= <span class="hljs-number">180</span>; j += <span class="hljs-number">10</span>) {
   19 ........&gt;         db.geo.save({ <span class="hljs-attr">name</span> : <span class="hljs-string">"Name/"</span> + i + <span class="hljs-string">"/"</span> + j, <span class="hljs-attr">loc</span>: [ i, j ] });
   20 ........&gt;     }
   21 ........&gt; }
   22 arangosh&gt; db.geo.count();
   23 <span class="hljs-number">703</span>
   24 arangosh&gt; db.geo.near(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>).limit(<span class="hljs-number">3</span>).toArray();
   25 [ 
   26   { 
   27     <span class="hljs-string">"_key"</span> : <span class="hljs-string">"120845"</span>, 
   28     <span class="hljs-string">"_id"</span> : <span class="hljs-string">"geo/120845"</span>, 
   29     <span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_Y2g7DWS--H"</span>, 
   30     <span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0/0"</span>, 
   31     <span class="hljs-string">"loc"</span> : [ 
   32       <span class="hljs-number">0</span>, 
   33       <span class="hljs-number">0</span> 
   34     ] 
   35   }, 
   36   { 
   37     <span class="hljs-string">"_key"</span> : <span class="hljs-string">"120734"</span>, 
   38     <span class="hljs-string">"_id"</span> : <span class="hljs-string">"geo/120734"</span>, 
   39     <span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_Y2g7DV2--D"</span>, 
   40     <span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/-10/0"</span>, 
   41     <span class="hljs-string">"loc"</span> : [ 
   42       <span class="hljs-number">-10</span>, 
   43       <span class="hljs-number">0</span> 
   44     ] 
   45   }, 
   46   { 
   47     <span class="hljs-string">"_key"</span> : <span class="hljs-string">"120842"</span>, 
   48     <span class="hljs-string">"_id"</span> : <span class="hljs-string">"geo/120842"</span>, 
   49     <span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_Y2g7DWS--F"</span>, 
   50     <span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0/-10"</span>, 
   51     <span class="hljs-string">"loc"</span> : [ 
   52       <span class="hljs-number">0</span>, 
   53       <span class="hljs-number">-10</span> 
   54     ] 
   55   } 
   56 ]
   57 arangosh&gt; db.geo.near(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>).count();
   58 <span class="hljs-literal">null</span>