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

Function getFieldFromDoc

lib/index.es.js:2865–2875  ·  view source on GitHub ↗
(doc, parsedField)

Source from the content-addressed store, hash-verified

2863// this would just be "return doc[field]", but fields
2864// can be "deep" due to dot notation
2865function getFieldFromDoc(doc, parsedField) {
2866 var value = doc;
2867 for (var i = 0, len = parsedField.length; i < len; i++) {
2868 var key = parsedField[i];
2869 value = value[key];
2870 if (!value) {
2871 break;
2872 }
2873 }
2874 return value;
2875}
2876
2877function compare(left, right) {
2878 return left < right ? -1 : left > right ? 1 : 0;

Callers 3

getFieldValuesAsArrayFunction · 0.70
rowFilterFunction · 0.70
matchSelectorFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…