code: func (q *TransactionQuery) Count(count *int) {
  	if q.hasError() {
  		q.tx.setError(q.err)
  		return
  	}
  	if !q.hasFilters() {
  		// Start by getting the number of models in the all index set
  		q.tx.Command("SCARD", redis.Args{q.collection.spec.indexKey()}, func(reply interface{}) error {
  			gotCount, err := redis.Int(reply, nil)
  			if err != nil {
  				return err
  			}
  			// Apply math to take into account limit and offset
  			if q.hasOffset() {
  				gotCount = gotCount - int(q.offset)
  			}
  			if q.hasLimit() && int(q.limit) < gotCount {
  				gotCount = int(q.limit)
  			}
  			// Assign the value of count
  			(*count) = gotCount
  			return nil
  		})
  	} else {
  		// If the query has filters, it is difficult to do any optimizations.
  		// Instead we'll just count the number of ids that match the query
  		// criteria. To do in a single transaction, we use the StoreIDs method and
  		// then add a LLEN command.
  		destKey := generateRandomKey("tmp:countDestKey")
  		q.StoreIDs(destKey)
  		q.tx.Command("LLEN", redis.Args{destKey}, NewScanIntHandler(count))
  		// Delete the temporary destKey when we're done.
  		q.tx.Command("DEL", redis.Args{destKey}, nil)
  	}
  }
docs: // Count will count the number of models that match the query criteria and set
  // the value of count. It works very similarly to Query.Count, so you can check
  // the documentation for Query.Count for more information. The first error
  // encountered will be saved to the corresponding Transaction (if there is not
  // already an error for the Transaction) and returned when you call
  // Transaction.Exec.