CouchDB for Coldfusion

PDF HTML FlashPaper

Main | Tutorials | OODB

OODB stands for "Object-Oriented Database". The goal of OODB.cfc is to provide a simple way to permanently store and retrieve Coldfusion objects (CFCs).

/OODB/OODB.cfc has 4 public methods:

  • Init()
  • Save()
  • Load()
  • Delete()

Init()

Init() prepares the component for interacting with CouchDB by setting the database properties. You must call this method first before using any of the other methods. Alternatively, you may set your database properties within the component itself.


Save()

Save() creates a new database record or updates an existing record.

To create a new record, pass in an object instance:

OODB.Save(myObject);

To update an existing record, pass in an object and the existing object's ID:

OODB.Save(myObject, myID);