Sounds like you understand purge; what you're looking for is part of a TBD feature we call "subsetting", i.e. being able to easily manage a local database as a subset of a remote one.
Currently, what you can do is create a new pull replication and set its documentIDs property to an array of the IDs of the documents you want to restore.
I've been doing some prototyping of better ways to manage this. The implementation so far is in a branch of couchbase-lite-ios called feature/query. It adds a method to CBLReplication to immediately download specific documents:
/** Requests that the replicator download the documents with the given IDs from the server
(EXPERIMENTAL).
This can only be called on a pull replication, obviously.
It's OK to call this while the replicator isn't running; the IDs will be remembered until
it starts. */
- (void) pullDocumentIDs: (NSArray*)docIDs;
There's also a method to run a query against the server database, but this requires an even-more-experimental Sync Gateway branch (also called feature/query) which exposes a view-query REST API to clients.
You're welcome to try it out; it's just that it hasn't been seriously tested, it's iOS-only for now, and the API is definitely subject to change in the future.
—Jens