(action, connection, id, collection, query, options, callback)
| 8 | // a set of conditions. |
| 9 | module.exports = Query; |
| 10 | function 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 | } |
| 40 | emitter.mixin(Query); |
| 41 | |
| 42 | Query.prototype.hasPending = function() { |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…