MCPcopy Create free account
hub / github.com/share/sharedb / Query

Function Query

lib/client/query.js:10–39  ·  view source on GitHub ↗
(action, connection, id, collection, query, options, callback)

Source from the content-addressed store, hash-verified

8// a set of conditions.
9module.exports = Query;
10function Query(action, connection, id, collection, query, options, callback) {
11 emitter.EventEmitter.call(this);
12
13 // 'qf' or 'qs'
14 this.action = action;
15
16 this.connection = connection;
17 this.id = id;
18 this.collection = collection;
19
20 // The query itself. For mongo, this should look something like {"data.x":5}
21 this.query = query;
22
23 // A list of resulting documents. These are actual documents, complete with
24 // data and all the rest. It is possible to pass in an initial results set,
25 // so that a query can be serialized and then re-established
26 this.results = null;
27 if (options && options.results) {
28 this.results = options.results;
29 delete options.results;
30 }
31 this.extra = undefined;
32
33 // Options to pass through with the query
34 this.options = options;
35
36 this.callback = callback;
37 this.ready = false;
38 this.sent = false;
39}
40emitter.mixin(Query);
41
42Query.prototype.hasPending = function() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…