class Replicator extends Database
A replicator database that allows people to manage replications:
- start replication
- cancel or stop replications
- list current replications
- Grouped
- Alphabetic
- By Inheritance
- Replicator
- Database
- DocumentOps
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
Value Members
-
object
changes
extends ChangeStream
Exposes the interface to change stream for this database.
Exposes the interface to change stream for this database.
- Definition Classes
- Database
-
object
index
extends Index
Exposes the interface for managing indices.
Exposes the interface for managing indices.
- Definition Classes
- Database
-
object
local
extends Local
Exposes the interface for managing local (non-replicating) documents.
Exposes the interface for managing local (non-replicating) documents.
- Definition Classes
- Database
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
allDocs(key: Option[String] = None, keys: Iterable[String] = Nil, startkey: Option[String] = None, startkey_docid: Option[String] = None, endkey: Option[String] = None, endkey_docid: Option[String] = None, limit: Int = 1, stale: Option[String] = None, descending: Boolean = false, skip: Int = 0, inclusive_end: Boolean = true): Future[List[String]]
Returns the list of identifiers of the documents in this database
Returns the list of identifiers of the documents in this database
- Definition Classes
- Database
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
attachTo(docId: String, attachment: String, stream: InputStream, contentType: String): Future[Boolean]
Attaches the given file (given as an input stream) to the given document id.
Attaches the given file (given as an input stream) to the given document id. If no mime type is given, sohva tries to guess the mime type of the file itself. It it does not manage to identify the mime type, the file won't be attached... This method returns
true
iff the file was attached to the document.- Definition Classes
- Database
-
def
attachTo(docId: String, file: File, contentType: String): Future[Boolean]
Attaches the given file to the given document id.
Attaches the given file to the given document id. This method returns
true
iff the file was attached to the document.- Definition Classes
- Database
-
def
builtInView(view: String): View
Returns a built-in view of this database, identified by its name.
Returns a built-in view of this database, identified by its name. E.g.
_all_docs
.- Definition Classes
- Database
-
def
bulkDocs[T](operations: Iterable[BulkOp[T]])(implicit arg0: CouchFormat[T]): Future[List[DbResult]]
Performs bulk document update.
Performs bulk document update.
- Definition Classes
- Database
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
compact: Future[Boolean]
Requests a database compaction.
Requests a database compaction.
- Definition Classes
- Database
-
def
copy(origin: String, target: String, originRev: Option[String] = None, targetRev: Option[String] = None): Future[Boolean]
Copies the origin document to the target document.
Copies the origin document to the target document. If the target does not exist, it is created, otherwise it is updated and the target revision must be provided
- Definition Classes
- Database
-
val
couch: CouchDB
- Definition Classes
- Database
-
def
create: Future[Boolean]
Creates this database in the couchdb instance if it does not already exist.
Creates this database in the couchdb instance if it does not already exist. Returns
true
iff the database was actually created.- Definition Classes
- Database
-
def
createDoc[T](doc: T)(implicit arg0: JsonWriter[T]): Future[DbResult]
Creates a document in the database and returns its identifier and revision.
Creates a document in the database and returns its identifier and revision. If the json version of the object has a
_id
field, this identifier is used for the document, otherwise a new one is generated.- Definition Classes
- Database
-
def
createDocs[T](docs: Iterable[T])(implicit arg0: JsonWriter[T]): Future[List[DbResult]]
Creates a set of documents in the database and returns theirs identifiers and revision.
Creates a set of documents in the database and returns theirs identifiers and revision. If the json version of an object has a
_id
field, this identifier is used for the document, otherwise a new one is generated.- Definition Classes
- Database
-
val
credit: Int
- Definition Classes
- Database → DocumentOps
-
def
delete: Future[Boolean]
Deletes this database in the couchdb instance if it exists.
Deletes this database in the couchdb instance if it exists. Returns
true
iff the database was actually deleted.- Definition Classes
- Database
-
def
deleteAttachment(docId: String, attachment: String): Future[Boolean]
Deletes the given attachment for the given docId
Deletes the given attachment for the given docId
- Definition Classes
- Database
-
def
deleteDoc(id: String): Future[Boolean]
Deletes the document identified by the given id from the database.
Deletes the document identified by the given id from the database. If the document exists it is deleted and the method returns
true
, otherwise returnsfalse
.- Definition Classes
- Database
-
def
deleteDoc[T](doc: T)(implicit arg0: CouchFormat[T]): Future[Boolean]
Deletes the document from the database.
Deletes the document from the database. The document will only be deleted if the caller provided the last revision
- Definition Classes
- DocumentOps
-
def
deleteDocRevs(docs: List[(String, String)]): Future[List[DbResult]]
Deletes a bunch of document revisions at once returning the results for each identifier in the document list.
Deletes a bunch of document revisions at once returning the results for each identifier in the document list. One can choose the update strategy by setting the parameter
all_or_nothing
totrue
orfalse
.- Definition Classes
- Database
-
def
deleteDocs(ids: Iterable[String]): Future[List[DbResult]]
Deletes a bunch of documents at once returning the results for each identifier in the document list.
Deletes a bunch of documents at once returning the results for each identifier in the document list. One can choose the update strategy by setting the parameter
all_or_nothing
totrue
orfalse
.- Definition Classes
- Database
-
def
design(designName: String, language: String = "javascript"): Design
Returns a design object that allows user to work with views
Returns a design object that allows user to work with views
- Definition Classes
- Database
-
implicit
val
ec: ExecutionContext
- Definition Classes
- Database → DocumentOps
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
exists: Future[Boolean]
Indicates whether this database exists
Indicates whether this database exists
- Definition Classes
- Database
-
def
explain(query: Query): Future[Explanation]
Explains how the query is run by the CouchDB server.
Explains how the query is run by the CouchDB server.
- Definition Classes
- Database
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
find[T <: AnyRef](query: Query)(implicit arg0: JsonReader[T]): Future[SearchResult[T]]
Finds documents using the declarative mango query syntax.
Finds documents using the declarative mango query syntax. See sohva.mango for details.
- Definition Classes
- Database
-
def
find[T <: AnyRef](selector: Selector, fields: Iterable[String] = Nil, sort: Seq[Sort], limit: Option[Int] = None, skip: Option[Int] = None, use_index: Option[UseIndex] = None)(implicit arg0: JsonReader[T]): Future[SearchResult[T]]
Finds documents using the declarative mango query syntax.
Finds documents using the declarative mango query syntax. See sohva.mango for details.
- Definition Classes
- Database
-
def
getAttachment(docId: String, attachment: String): Future[Option[(String, ByteString)]]
Returns the given attachment for the given docId.
Returns the given attachment for the given docId. It returns the mime type if any given in the response and the input stream to read the response from the server.
- Definition Classes
- Database
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
getDocById[T](id: String, revision: Option[String] = None)(implicit arg0: JsonReader[T]): Future[Option[T]]
Returns the document identified by the given id if it exists
Returns the document identified by the given id if it exists
- Definition Classes
- DocumentOps
-
def
getDocRevision(id: String): Future[Option[String]]
Returns the current revision of the document if it exists
Returns the current revision of the document if it exists
- Definition Classes
- Database
-
def
getDocRevisions(ids: Iterable[String]): Future[List[(String, String)]]
Returns the current revision of the documents
Returns the current revision of the documents
- Definition Classes
- Database
-
def
getDocsById[T](ids: Iterable[String])(implicit arg0: JsonReader[T]): Future[List[T]]
Returns all the documents with given identifiers and of the given type.
Returns all the documents with given identifiers and of the given type. If the document with an identifier exists in the database but has not the required type, it is not added to the result
- Definition Classes
- Database
-
def
getRevsLimit: Future[Int]
Gets the current database revision limit.
Gets the current database revision limit.
- Definition Classes
- Database
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
def
http(req: HttpRequest): Future[JsValue]
- Attributes
- protected[gnieh.sohva]
- Definition Classes
- Database → DocumentOps
-
def
info: Future[Option[InfoResult]]
Returns the information about this database
Returns the information about this database
- Definition Classes
- Database
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
missingRevs(revs: Map[String, Iterable[String]]): Future[Map[String, Vector[String]]]
Returns the revision for each document in the map that are not present in this node.
Returns the revision for each document in the map that are not present in this node.
- Definition Classes
- Database
-
val
name: String
- Definition Classes
- Database
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
optHttp(req: HttpRequest): Future[Option[JsValue]]
- Attributes
- protected[gnieh.sohva]
- Definition Classes
- Database → DocumentOps
-
def
patchDoc[T](id: String, rev: String, patch: diffson.sprayJson.JsonPatch)(implicit arg0: CouchFormat[T]): Future[T]
Patches the document identified by the given identifier in the given revision.
Patches the document identified by the given identifier in the given revision. This will work if the revision is the last one, or if it is not but the automatic conflict manager manages to solve the potential conflicts. The patched revision is returned. If something went wrong, an exception is raised
- Definition Classes
- Database
-
def
revsDiff(revs: Map[String, Iterable[String]]): Future[Map[String, RevDiff]]
Given a list of documents and revisions, returns the revision that are missing in this node.
Given a list of documents and revisions, returns the revision that are missing in this node.
- Definition Classes
- Database
-
def
saveDoc[T](doc: T)(implicit arg0: CouchFormat[T]): Future[T]
Creates or updates the given object as a document into this database The given object must have an
_id
and an optional_rev
fields to conform to the couchdb document structure.Creates or updates the given object as a document into this database The given object must have an
_id
and an optional_rev
fields to conform to the couchdb document structure. The saved revision is returned. If something went wrong, an exception is raised- Definition Classes
- DocumentOps
-
def
saveDocs[T](docs: Iterable[T])(implicit arg0: CouchFormat[T]): Future[List[DbResult]]
Creates or updates a bunch of documents into the database.
Creates or updates a bunch of documents into the database.
- Definition Classes
- Database
-
def
saveRawDoc(doc: JsValue): Future[JsValue]
- Attributes
- protected[this]
- Definition Classes
- DocumentOps
-
def
saveSecurityDoc(doc: SecurityDoc): Future[Boolean]
Creates or updates the security document.
Creates or updates the security document. Security documents are special documents with no
_id
nor_rev
fields.- Definition Classes
- Database
-
def
securityDoc: Future[SecurityDoc]
Returns the security document of this database if any defined
Returns the security document of this database if any defined
- Definition Classes
- Database
-
def
setRevsLimit(l: Int): Future[Boolean]
Sets the current database revision limit.
Sets the current database revision limit.
- Definition Classes
- Database
-
def
start(replication: Replication): Future[Replication]
Starts a new replication from
source
totarget
.Starts a new replication from
source
totarget
. if a replication task already exists for the same source and target, the document is added but the replication is not started again. The result only contains the identifier of the actual replication task, not its state. -
def
stop(id: String): Future[Boolean]
Stops the replication identified by the given replication document id.
Stops the replication identified by the given replication document id. if the identifier does not describe the document that started the replication, it is deleted from the replicator database, but the replication task is not stopped. It returns
true
only if the replication was actually stopped,false
otherwise. -
val
strategy: Strategy
- Definition Classes
- Database → DocumentOps
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- Database → AnyRef → Any
-
val
uri: Uri
- Attributes
- protected[gnieh.sohva]
- Definition Classes
- Database → DocumentOps
-
def
viewCleanup: Future[Boolean]
Cleanups old views.
Cleanups old views.
- Definition Classes
- Database
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Deprecated Value Members
-
def
_all_docs(key: Option[String] = None, keys: Iterable[String] = Nil, startkey: Option[String] = None, startkey_docid: Option[String] = None, endkey: Option[String] = None, endkey_docid: Option[String] = None, limit: Int = 1, stale: Option[String] = None, descending: Boolean = false, skip: Int = 0, inclusive_end: Boolean = true): Future[List[String]]
- Definition Classes
- Database
- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) Use
allDocs
instead
-
def
bulkDocs[T](operations: Iterable[BulkOp[T]], all_or_nothing: Boolean)(implicit arg0: CouchFormat[T]): Future[List[DbResult]]
Performs bulk document update.
Performs bulk document update.
- Definition Classes
- Database
- Annotations
- @deprecated
- Deprecated
(Since version Sohva 2.2.0)
all_or_nothing
was removed in CouchDB 2.0 and will have no effect
-
def
deleteDocRevs(docs: List[(String, String)], all_or_nothing: Boolean = false): Future[List[DbResult]]
Deletes a bunch of document revisions at once returning the results for each identifier in the document list.
Deletes a bunch of document revisions at once returning the results for each identifier in the document list. One can choose the update strategy by setting the parameter
all_or_nothing
totrue
orfalse
.- Definition Classes
- Database
- Annotations
- @deprecated
- Deprecated
(Since version Sohva 2.2.0)
all_or_nothing
was removed in CouchDB 2.0 and will have no effect
-
def
deleteDocs(ids: Iterable[String], all_or_nothing: Boolean): Future[List[DbResult]]
Deletes a bunch of documents at once returning the results for each identifier in the document list.
Deletes a bunch of documents at once returning the results for each identifier in the document list. One can choose the update strategy by setting the parameter
all_or_nothing
totrue
orfalse
.- Definition Classes
- Database
- Annotations
- @deprecated
- Deprecated
(Since version Sohva 2.2.0)
all_or_nothing
was removed in CouchDB 2.0 and will have no effect
-
def
ensureFullCommit: Future[Boolean]
Ensures that all changes are written to disk.
Ensures that all changes are written to disk.
- Definition Classes
- Database
- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) You shouldn't need to call this if you have the recommended setting
delayed_commits=false
-
def
getRawDocById(id: String, revision: Option[String] = None): Future[Option[JsValue]]
Returns the raw representation of the document identified by the given id if it exists.
Returns the raw representation of the document identified by the given id if it exists.
- Definition Classes
- Database
- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) Use
getDocById
with return typeJsValue
instead
-
def
saveDocs[T](docs: Iterable[T], all_or_nothing: Boolean)(implicit arg0: CouchFormat[T]): Future[List[DbResult]]
Creates or updates a bunch of documents into the database.
Creates or updates a bunch of documents into the database.
- Definition Classes
- Database
- Annotations
- @deprecated
- Deprecated
(Since version Sohva 2.2.0)
all_or_nothing
was removed in CouchDB 2.0 and will have no effect
-
def
temporaryView(viewDoc: ViewDoc): View
Returns a temporary view of this database, specified by the
ViewDoc
.Returns a temporary view of this database, specified by the
ViewDoc
.- Definition Classes
- Database
- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) Temporary view were removed in CouchDB 2.0 and should not be used
CouchDB1
Operation only available in CouchDB 1
CouchDB2
Operation only available in CouchDB 2
Ungrouped
LowLevel
Low-level classes that may break compatibility even between patch and minor versions