diff options
author | Keith Bostic <keith@wiredtiger.com> | 2013-07-17 11:39:54 -0400 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2013-07-17 11:39:54 -0400 |
commit | 2a6dcba24e67b504bc7c898ca4ef1d4d79bf71a4 (patch) | |
tree | 4aaf05a017a8e74d47956921d8873a601246756f /src/docs/cursors.dox | |
parent | 8749bcc2c3e8de81985a8f2df7b58611440721c7 (diff) | |
download | mongo-2a6dcba24e67b504bc7c898ca4ef1d4d79bf71a4.tar.gz |
Add a more complex raw mode example, plus an example showing a projection
combined with raw mode.
Diffstat (limited to 'src/docs/cursors.dox')
-rw-r--r-- | src/docs/cursors.dox | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/docs/cursors.dox b/src/docs/cursors.dox index b507aba47fd..8c1327d8980 100644 --- a/src/docs/cursors.dox +++ b/src/docs/cursors.dox @@ -84,6 +84,11 @@ columns. This is done by listing the column names in parenthesis in the <code>uri</code> parameter to WT_SESSION::open_cursor. Only the fields from the listed columns are returned by WT_CURSOR::get_value. +The @ex_ref{ex_schema.c} example creates a table where the value format is +\c "5sHq", where the initial string is the country, the short is a year, +and the long is a population. The following example lists just the country +and year columns from the table record values: + @snippet ex_schema.c Return a subset of values from the table This is particularly useful with index cursors, because if all columns in @@ -107,4 +112,17 @@ WT_CURSOR::set_key and WT_CURSOR::set_value in raw mode, the WT_ITEM should be equivalent to calling WT_EXTENSION_API::struct_pack for the cursor's \c key_format or \c value_format, respectively. +The @ex_ref{ex_schema.c} example creates a table where the value format is +\c "5sHq", where the initial string is the country, the short is a year, +and the long is a population. The following example lists the table record +values, using raw mode: + +@snippet ex_schema.c List the records in the table using raw mode. + +Raw mode can be used in combination with projections. The following +example lists just the country and year columns from the table record +values, using raw mode: + +@snippet ex_schema.c Return a subset of values from the table using raw mode + */ |