DocumentPutExistingRevision Method |
Adds an existing revision copied from another database. Unlike a normal insertion, this does
not assign a new revision ID; instead the revision's ID must be given. Ths revision's history
(ancestry) must be given, which can put it anywhere in the revision tree. It's not an error if
the revision already exists locally; it will just be ignored.
This is not an operation that clients normall perform; it's used by the replicator. You might want
to use it if you're pre-loading a database with canned content, or if you're implementing some new
kind of replicator that transfers revisions from another database
Namespace:
Couchbase.Lite
Assembly:
Couchbase.Lite (in Couchbase.Lite.dll) Version: 1.4.1-b107
Syntax public bool PutExistingRevision(
IDictionary<string, Object> properties,
IDictionary<string, Stream> attachments,
IList<string> revisionHistory,
Uri sourceUri
)
Parameters
- properties
- Type: System.Collections.GenericIDictionaryString, Object
The properties of the revision (_id and _rev will be ignored but _deleted
and _attachments are recognized) - attachments
- Type: System.Collections.GenericIDictionaryString, Stream
A dictionary providing attachment bodies. The keys are the attachment
names (matching the keys in the properties `_attachments` dictionary) and the values are streams
that contain the attachment bodies. - revisionHistory
- Type: System.Collections.GenericIListString
The revision history in the form of an array of revision-ID strings, in
reverse chronological order. The first item must be the new revision's ID. Following items are its
parent's ID, etc. - sourceUri
- Type: SystemUri
The URL of the database this revision came from, if any. (This value
shows up in the Database Changed event triggered by this insertion, and can help clients decide
whether the change is local or not)
Return Value
Type:
Booleantrue on success, false otherwise
See Also