Module: WingedCouch::Native::Databases::Operations

Included in:
WingedCouch::Native::Database
Defined in:
lib/winged_couch/native/databases/operations.rb

Overview

Module with methods for making operations on the database

Instance Method Summary collapse

Instance Method Details

#changes(options = {}) ⇒ Object

Returns changes for current database


31
32
33
# File 'lib/winged_couch/native/databases/operations.rb', line 31

def changes(options = {})
  HTTP.get path.join("_changes"), options
end

#compactObject

Compacts all views in the database. Returns { “ok” => true }


39
40
41
# File 'lib/winged_couch/native/databases/operations.rb', line 39

def compact
  HTTP.post path.join("_compact")
end

#compact_doc(doc_id) ⇒ Object

Compacts current version of views in the document with passed doc_id


47
48
49
# File 'lib/winged_couch/native/databases/operations.rb', line 47

def compact_doc(doc_id)
  HTTP.post path.join("_compact/#{doc_id}")
end

#documents_countFixnum

Returns count of documents in the database.


19
20
21
# File 'lib/winged_couch/native/databases/operations.rb', line 19

def documents_count
  info["doc_count"]
end

#ensure_full_commitObject

Commits any recent changes to the specified database to disk


59
60
61
# File 'lib/winged_couch/native/databases/operations.rb', line 59

def ensure_full_commit
  HTTP.post path.join("_ensure_full_commit")
end

#infoObject

Returns information about the database


11
12
13
# File 'lib/winged_couch/native/databases/operations.rb', line 11

def info
  HTTP.get path
end

#view_cleanupObject

Compacts all versions if views in current database


53
54
55
# File 'lib/winged_couch/native/databases/operations.rb', line 53

def view_cleanup
  HTTP.post path.join("_view_cleanup")
end