summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2014-12-11 19:32:50 -0500
committerKeith Bostic <keith@wiredtiger.com>2014-12-11 19:32:50 -0500
commit4c26d2324bae1d7030b0142d50dbd2ccf11ddeb6 (patch)
tree2a503b40b20650427eb66039766eb5c9575ce3c7 /examples
parent9b33b7c46a2672f36b9673d5e4cbc7315bc9ecf4 (diff)
downloadmongo-4c26d2324bae1d7030b0142d50dbd2ccf11ddeb6.tar.gz
Add support for a WT_CURSOR.reconfigure method, reference #1381.
Diffstat (limited to 'examples')
-rw-r--r--examples/c/ex_all.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/examples/c/ex_all.c b/examples/c/ex_all.c
index 4fe6a2f265a..db418deed9d 100644
--- a/examples/c/ex_all.c
+++ b/examples/c/ex_all.c
@@ -94,20 +94,16 @@ cursor_ops(WT_SESSION *session)
}
{
- WT_CURSOR *overwrite_cursor;
const char *key = "some key", *value = "some value";
/*! [Reconfigure a cursor] */
ret = session->open_cursor(
- session, "table:mytable", NULL, NULL, &cursor);
+ session, "table:mytable", NULL, "overwrite=false", &cursor);
cursor->set_key(cursor, key);
+ cursor->set_value(cursor, value);
/* Reconfigure the cursor to overwrite the record. */
- ret = session->open_cursor(
- session, NULL, cursor, "overwrite", &overwrite_cursor);
- ret = cursor->close(cursor);
-
- overwrite_cursor->set_value(overwrite_cursor, value);
- ret = overwrite_cursor->insert(cursor);
+ ret = cursor->reconfigure(cursor, "overwrite=true");
+ ret = cursor->insert(cursor);
/*! [Reconfigure a cursor] */
}