MCPcopy Index your code
hub / github.com/totaljs/framework / checkRelation

Function checkRelation

graphdb.js:1061–1080  ·  view source on GitHub ↗
(self, relation, indexA, indexB, callback)

Source from the content-addressed store, hash-verified

1059}
1060
1061function checkRelation(self, relation, indexA, indexB, callback) {
1062
1063 self.read(indexA, function(err, docs, relid) {
1064
1065 if (docs) {
1066 for (var i = 0; i < docs.length; i++) {
1067 var doc = docs[i];
1068 if (doc.ID === indexB && (relation.both || doc.INIT)) {
1069 callback(null, true);
1070 return;
1071 }
1072 }
1073 }
1074
1075 if (relid)
1076 setImmediate(checkRelation, self, relation, relid, indexB, callback);
1077 else
1078 callback(null, false);
1079 });
1080}
1081
1082function updMeta(self, type) {
1083 var buf;

Callers 1

addRelationFunction · 0.85

Calls 1

callbackFunction · 0.85

Tested by

no test coverage detected