MCPcopy Index your code
hub / github.com/share/sharedb / getQueryOptions

Function getQueryOptions

lib/agent.js:504–533  ·  view source on GitHub ↗
(request)

Source from the content-addressed store, hash-verified

502 }
503};
504function getQueryOptions(request) {
505 var results = request.r;
506 var ids;
507 var fetch;
508 var fetchOps;
509 if (results) {
510 ids = [];
511 for (var i = 0; i < results.length; i++) {
512 var result = results[i];
513 var id = result[0];
514 var version = result[1];
515 ids.push(id);
516 if (version == null) {
517 if (fetch) {
518 fetch.push(id);
519 } else {
520 fetch = [id];
521 }
522 } else {
523 if (!fetchOps) fetchOps = Object.create(null);
524 fetchOps[id] = version;
525 }
526 }
527 }
528 var options = request.o || {};
529 options.ids = ids;
530 options.fetch = fetch;
531 options.fetchOps = fetchOps;
532 return options;
533}
534
535Agent.prototype._queryFetch = function(queryId, collection, query, options, callback) {
536 // Fetch the results of a query once

Callers 1

agent.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…