summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2011-01-28 16:34:15 +1100
committerMichael Cahill <michael.cahill@wiredtiger.com>2011-01-28 16:34:15 +1100
commit7c6c8d65f48ee4eb91daa02ac108cc1c51bfc4bb (patch)
treeeb9fbe4ee6e9ced4993da7d3b94bab375a5c5814 /docs
parent2a4f3179f5c2d53303dc78250687387cbf184563 (diff)
downloadmongo-7c6c8d65f48ee4eb91daa02ac108cc1c51bfc4bb.tar.gz
[#23] Permit JSON config strings. Change "column set" to "column group" / "colgroup" consistently. Change schema configration to use unique JSON-friendly keys, so "index.name=(columns)" instead of "index=name(columns)".
--HG-- branch : mjc
Diffstat (limited to 'docs')
-rw-r--r--docs/src/config-strings.dox29
-rw-r--r--docs/src/cursors.dox6
-rw-r--r--docs/src/schema.dox4
3 files changed, 33 insertions, 6 deletions
diff --git a/docs/src/config-strings.dox b/docs/src/config-strings.dox
index bfe6e364c2f..950585c2396 100644
--- a/docs/src/config-strings.dox
+++ b/docs/src/config-strings.dox
@@ -24,6 +24,32 @@ Superfluous commas and whitespace in the configuration string are ignored (inclu
Keys are processed in order from left to right, with later settings overriding earlier ones unless multiple settings for a key are permitted.
+@section config_json JSON compatibility
+
+The parser for configuration strings will accept additional formatting as follows:
+
+- parentheses may be round or square brackets or curly braces: '()', '[]' or '{}'
+- the whole configuration string may optionally be wrapped in parentheses
+- the key/value separator can be a colon: ':'
+- keys and values may be in double quotes: '"'
+- quoted strings are interpreted as UTF-8 values
+
+The result of this relaxed parsing is that applications may pass strings representing valid <a href="http://json.org/">JSON objects</a> wherever configuration strings are required.
+
+For example, in Python, code might look as follows:
+
+\code
+ import json
+ config = json.dumps({
+ "key_format" : "r",
+ "value_format" : "5sHQ",
+ "columns" : ("id", "country", "year", "population"),
+ "colgroup.population" : ["population"],
+ "index.country_year" : ["country", "year"]
+ })
+\endcode
+
+
@section config_examples Code Samples
The code below is taken from the complete example program @ex_ref{ex_config.c}.
@@ -39,7 +65,8 @@ Open a connection to a database, creating it if it does not exist and set a cach
Create a table that uses C language strings for keys and values:
-@skipline create_table
+@skip create_table
+@until ;
Assign a priority to a transaction and give it a name for debugging:
diff --git a/docs/src/cursors.dox b/docs/src/cursors.dox
index 00dfb2f6453..a0d57dd6e59 100644
--- a/docs/src/cursors.dox
+++ b/docs/src/cursors.dox
@@ -34,7 +34,7 @@ The following are builtin cursor types:
<table>
<tr><th>URI</th><th>Function</th></tr>
<tr><td><tt>table:[\<tablename\>]</tt></td><td>ordinary table cursor</td></tr>
-<tr><td><tt>columnset:[\<tablename\>.\<columnset\>]</tt></td><td>column set cursor</td></tr>
+<tr><td><tt>colgroup:[\<tablename\>.\<columnset\>]</tt></td><td>column group cursor</td></tr>
<tr><td><tt>index:[\<tablename\>.\<index\>]</tt></td><td>index cursor</td></tr>
<tr><td><tt>join:\<cursor1\>\&\<cursor2\>[&\<cursor3\>...]</tt></td><td>Join the contents of multiple cursors together.</td></tr>
<tr><td><tt>module:</tt></td><td>loadable modules (key=(string)name, data=(string)path)</td></tr>
@@ -46,9 +46,9 @@ The following are builtin cursor types:
@section cursor_projections Projections
-Cursors on tables, column sets and indices can return a subset of columns. This is done by listing the column names in parantheses in the <code>uri</code> parameter to WT_SESSION::open_cursor. Only the fields from the listed columns are returned by WT_CURSOR::get_key and WT_CURSOR::get_value.
+Cursors on tables, column groups and indices can return a subset of columns. This is done by listing the column names in parantheses in the <code>uri</code> parameter to WT_SESSION::open_cursor. Only the fields from the listed columns are returned by WT_CURSOR::get_key and WT_CURSOR::get_value.
-This is particularly useful with index cursors, because if all columns in the projection are available in the index (including primary key columns, which are the values of the index), there is no need to access any column set.
+This is particularly useful with index cursors, because if all columns in the projection are available in the index (including primary key columns, which are the values of the index), there is no need to access any column groups.
@section cursor_ranges Restricting the Range of a Scan
diff --git a/docs/src/schema.dox b/docs/src/schema.dox
index 9c2050a00dd..a121d1b6c9a 100644
--- a/docs/src/schema.dox
+++ b/docs/src/schema.dox
@@ -40,9 +40,9 @@ Applications describe the format of their data by supplying a schema to WT_SESSI
@todo describe how to add columns to a schema
-@section schema_column_sets Storing Sets of Columns Together
+@section schema_column_groups Storing Groups of Columns Together
-@todo define and describe column sets
+@todo define and describe column groups
@section schema_indices Adding an Index