Search:

Search all manuals
Search this manual
Manual
Membase and Python Tutorial
Additional Resources
Community Wiki
Community Forums
Couchbase SDKs
Parent Section
Membase and Python Tutorial
Chapter Sections
Chapters

4. Minimal Examples

4.1. Quick Save and Retrieve
4.2. Saving Data
4.3. Retrieving Data

The following Python scripting examples can be run as scripts, when saved as a .py file, or run interactively through the Python interpreter. The first is as minimal as you can get, the others show you a bit more context.

The Saving Data example shows you the quickest way to set, add, and update a document in the database. The Retrieving Data section shows the simplest way to retrieve, get, and extract information.

Both scripts involve four steps:

Additional methods are used in the scripts to make them easy to use and to demonstrate basic ways of applying Python to these types of problems. For more advanced scripting see the Test Script section later in this Getting Started guide.