MCPcopy Index your code
hub / github.com/apache/pouchdb / checkQueryParseError

Function checkQueryParseError

lib/index-browser.js:8255–8279  ·  view source on GitHub ↗
(options, fun)

Source from the content-addressed store, hash-verified

8253 }
8254
8255 function checkQueryParseError(options, fun) {
8256 const startkeyName = options.descending ? 'endkey' : 'startkey';
8257 const endkeyName = options.descending ? 'startkey' : 'endkey';
8258
8259 if (typeof options[startkeyName] !== 'undefined' &&
8260 typeof options[endkeyName] !== 'undefined' &&
8261 collate(options[startkeyName], options[endkeyName]) > 0) {
8262 throw new QueryParseError('No rows can match your key range, ' +
8263 'reverse your start_key and end_key or set {descending : true}');
8264 } else if (fun.reduce && options.reduce !== false) {
8265 if (options.include_docs) {
8266 throw new QueryParseError('{include_docs:true} is invalid for reduce');
8267 } else if (options.keys && options.keys.length > 1 &&
8268 !options.group && !options.group_level) {
8269 throw new QueryParseError('Multi-key fetches for reduce views must use ' +
8270 '{group: true}');
8271 }
8272 }
8273 for (const optionName of ['group_level', 'limit', 'skip']) {
8274 const error = checkPositiveInteger(options[optionName]);
8275 if (error) {
8276 throw error;
8277 }
8278 }
8279 }
8280
8281 async function httpQuery(db, fun, opts) {
8282 // List of parameters to add to the PUT request

Callers 1

queryPromisedFunction · 0.70

Calls 2

collateFunction · 0.70
checkPositiveIntegerFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…