Skip to content
mluto edited this page Feb 24, 2013 · 5 revisions

Complete me based on src/server/model.coffee

Available Methods

create (docName, type, meta, callback)

  • docName, the name of the doc to create
  • type, the type of the doc to create
  • meta (optional), ???
  • callback

delete (docName, callback)

  • docName, the name of the doc to delete
  • callback

WARNING: This isn't well supported throughout the code. E.g.: Streaming clients aren't told about the deletion and subsequent op submissions will fail.

getOps (docName, start, end, callback)

  • docName, the name of the doc to get ops from
  • start, first op to get
  • end, can be null, which means 'get me all ops from start'.
  • callback, function (error, [ops])

Gets all operations from [start...end]. (That is, its not inclusive.) Each op returned is in the form {op:o, meta:m, v:version}.

getSnapshot (docName, callback)

  • docName
  • callback

getVersion (docName, callback)

  • docName
  • callback

applyOp (docName, opData, callback)

  • docName
  • opData
  • callback

applyMetaOp (docName, metaOpData, callback)

  • docName
  • metaOpData
  • callback

listen (docName, version, listener, callback)

  • docName
  • version
  • listener
  • callback

removeListener (docName, listener)

  • docName
  • listener

flush()

closeDb()

Clone this wiki locally