MB-7629: Rename function to be generic for both db and views

Change-Id: I6d69ac7084a20362dee57033fa5a509ba3e63e29
Reviewed-on: http://review.couchbase.org/26919
Tested-by: Fulu Li <fulu@couchbase.com>
Reviewed-by: Fulu Li <fulu@couchbase.com>