added support for document rev (for optimistic locking)