func (qr *queryRequest) Collection(collection interface{}) {
	if qr.h.Type == TypeModel {
		panic("res: collection response not allowed on query models")
	}
	qr.success(collectionResponse{Collection: collection})
}
Collection sends a collection response for the query request.
The collection represents the current state of query collection
for the given query.
Only valid for a query collection resource.
package res
import (
	"encoding/json"
	"errors"
	"fmt"
	"strconv"
	"time"
	nats "github.com/nats-io/nats.go"
)
const queryEventChannelSize = 10
type QueryRequest interface {
	Resource
	Model(model interface{})
	Collection(collection interface{})
	NotFound()
	InvalidQuery(message string)
	Error(err error)
	Timeout(d time.Duration)
}
type queryRequest struct {
	resource
	msg     *nats.Msg
	events  []resEvent
	replied bool  
}
type queryEvent struct {
	r   resource
	sub *nats.Subscription
	ch  chan *nats.Msg
	cb  func(r QueryRequest)
}
func (qr *queryRequest) Model(model interface{}) {
	if qr.h.Type == TypeCollection {
		panic("res: model response not allowed on query collections")
	}
	qr.success(modelResponse{Model: model})
}