(request)
| 502 | } |
| 503 | }; |
| 504 | function 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 | |
| 535 | Agent.prototype._queryFetch = function(queryId, collection, query, options, callback) { |
| 536 | // Fetch the results of a query once |
no outgoing calls
no test coverage detected
searching dependent graphs…