From 9652d055a69dce5c120657df850e3871a9ad97a1 Mon Sep 17 00:00:00 2001 From: Andrew Henry Date: Fri, 18 Apr 2025 15:15:22 -0700 Subject: [PATCH] Add some docs --- .../persistence/couch/CouchObjectProvider.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/plugins/persistence/couch/CouchObjectProvider.js b/src/plugins/persistence/couch/CouchObjectProvider.js index 271db39daa..9df2a05eca 100644 --- a/src/plugins/persistence/couch/CouchObjectProvider.js +++ b/src/plugins/persistence/couch/CouchObjectProvider.js @@ -443,6 +443,22 @@ class CouchObjectProvider { return response.ok; } + /** + * @typedef GetObjectByViewOptions + * @property {String} designDoc the name of the design document that the view belongs to + * @property {String} viewName + * @property {Array.} [keysToSearch] a list of discrete view keys to search for. View keys are not object identifiers. + * @property {String} [startKey] limit the search to a range of keys starting with the provided `startKey`. One of `keysToSearch` OR `startKey` AND `endKey` must be provided + * @property {String} [endKey] limit the search to a range of keys ending with the provided `endKey`. One of `keysToSearch` OR `startKey` AND `endKey` must be provided + * @property {Number} [limit] limit the number of results returned + * @property {String} [objectIdField] The field (either key or value) to treat as an object key. If provided, include_docs will be set to false in the request, and the field will be used as an object identifier. A bulk request will be used to resolve objects from identifiers + */ + /** + * Return objects based on a call to a view. See https://docs.couchdb.org/en/stable/api/ddoc/views.html. + * @param {GetObjectByViewOptions} options + * @param {AbortSignal} abortSignal + * @returns {Promise>} + */ async getObjectsByView( { designDoc, viewName, keysToSearch, startKey, endKey, limit, objectIdField }, abortSignal