Skip to content
Snippets Groups Projects
Commit 686d567f authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

User guide: document some box.index methods.

parent b6ae6e33
No related branches found
No related tags found
No related merge requests found
......@@ -578,8 +578,8 @@ Note: the administrative console output must be YAML-compatible.
<title>Package <code xml:id="box.tuple" xreflabel="box.tuple">box.tuple</code></title>
<para>The package contains no functions, but stands for
<code>box.tuple</code> userdata type. It is possible to access individual
tuple fields using an index, or iterate over all fields in a
tuple. Tuples are immutable.</para>
tuple fields using an index, iterate over all fields in a
tuple or convert a tuple to a Lua table. Tuples are immutable.</para>
<varlistentry>
<term><emphasis role="lua"> </emphasis></term>
<listitem><para>
......@@ -610,6 +610,15 @@ efg
ghq
qkl
...
localhost> lua t:unpack()
---
-
- abc
- cde
- efg
- ghq
- qkl
...
</programlisting>
</para></listitem>
......@@ -751,14 +760,9 @@ localhost> lua for k,v in box.space[0]:pairs() do print(v) end
xreflabel="box.index">box.index</code></title>
<para>This package implements methods of type <code>box.index</code>.</para>
<varlistentry>
<term><emphasis role="lua">index.n</emphasis></term>
<listitem><simpara>Ordinal index number in the space, <code>space.index[i].n == i</code>.</simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis role="lua">index.enabled</emphasis></term>
<term><emphasis role="lua">index.unique</emphasis></term>
<listitem><simpara>
Whether or not this index is enabled in the
configuration file.
Boolean, true if the index is unique.
</simpara></listitem>
</varlistentry>
......@@ -771,6 +775,15 @@ xreflabel="box.index">box.index</code></title>
</simpara></listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis role="lua">index.key_field[]</emphasis>
</term>
<listitem><simpara>
An array describing index key fields.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis role="lua">index.idx</emphasis>
......@@ -789,6 +802,40 @@ xreflabel="box.index">box.index</code></title>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis role="lua">index:min()</emphasis>
</term>
<listitem><simpara>
The smallest value in the index. Available only for
indexes of type 'TREE'.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis role="lua">index:max()</emphasis>
</term>
<listitem><simpara>
The biggest value in the index. Available only for
indexes of type 'TREE'.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis role="lua">index:next()</emphasis>
</term>
<listitem><simpara>
This function can be used for positioned iteration, or
resuming iteration from a given key.
</simpara>
</listitem>
</varlistentry>
</variablelist>
<variablelist>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment