CFCouchbase SDK
  • Introduction
  • What's New With 2.2.0
  • What's New With 2.0.0
  • About This Book
  • Authors
  • Overview
  • Installation
    • ColdBox Module
    • Traditional Apps
  • Configuration
    • Settings
    • Structure
    • Summary
  • Usage
    • Storing Documents
    • Storage Durability
    • Retrieving Documents
    • Data Serialization
    • Components
      • Auto Inflation
      • Manual Inflation
      • Custom Serialization
      • Binary
    • Custom Transformers
    • Executing Queries
      • View Queries
      • n1ql Queries
      • Query Options
      • Filter Closures
      • Transform Closures
      • Return Types
    • Managing Views
    • Working With Futures
  • Help & Support
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
Export as PDF
  1. Usage

Retrieving Documents

PreviousStorage DurabilityNextData Serialization

Last updated 7 years ago

Was this helpful?

The easiest way to retrieve a specific document by ID from your Couchbase cluster is by calling the get() method.

person = client.get( id = "brad" );

There are many other methods for getting data. Please check the (in the download) to see full descriptions and code samples for all of them.

  • getMulti() - Get multiple objects from couchbase with a single call.

  • getAndTouch() - Get a document and update its expiry value

  • getAndLock() - Get a document and lock it for a specified amount of time

  • getFromReplica() - Get a document from a replica

  • getWithCAS() - Get an object from couchbase with a special Compare And Swap (CAS) version (for use wit replaceWithCAS())

  • n1qlQuery() - Get a document using a N1QL query

API Docs