// Count the number of records in the database.
//
//	c.Count(&User{})
358856
func (c *Connection) Count(model interface{}) (int, error) {
	return Q(c).Count(model)
}
1244969
func (s *Subscriber) Count() int {
	s.mu.Lock()
	defer s.mu.Unlock()
	return s.count()
}
1178641
func (c *Client) Count(indices ...string) *CountService {
	return NewCountService(c).Index(indices...)
}
861827
func (n *node) Count(data interface{}) (int, error) {
	return n.Select().Count(data)
}
113848
func (self *Record) Count(zoneId, version int64) (int64, error) {
	var result int64
	params := []interface{}{self.Key, zoneId, version}
	if err := self.Call("domain.zone.record.count", params, &result); err != nil {
		return -1, err
	}
	return result, nil
}
876585
func (c *counters) Counts() map[string]int64 {
	c.mu.RLock()
	defer c.mu.RUnlock()

	counts := make(map[string]int64, len(c.counts))
	for k, a := range c.counts {
		counts[k] = atomic.LoadInt64(a)
	}
	return counts
}
396242
func (b *UpdateBuilder) Limit(count interface{}) *UpdateBuilder {
	if b.Update.Limit == nil {
		b.Update.Limit = &Limit{}
	}
	b.Update.Limit.Rowcount = makeValExpr(count)
	return b
}
1077243
func (s *RedisDeviceStore) Count() (int, error) {
	opts := new(storage.ListOptions)
	opts.UseCache(s.listResultCacheKey("_all_"), listCacheTTL)
	return s.store.Count("", opts)
}
1132646
func (limit *simpleLimiter) Count(n int) error {
	now := time.Now()
	if now.After(limit.timeRead) {
		limit.numRead = 0
		limit.timeRead = now.Add(limit.Frequency)
	}
	limit.numRead += n
	if limit.numRead > limit.Amount {
		return ErrRateExceeded
	}
	return nil
}
835657
func (op *op) count() int {
	switch op.typ {
	case 0, 1:
		return 1
	case 2, 3:
		return len(op.values)
	default:
		panic(fmt.Sprintf("unknown operation type: %d", op.typ))
	}
}
511935
func (p *Session) All() (ret int) {
	p.db.Query("select count(*) from " + TABLE_NAME).Row(&ret)
	return
}
313290
func (c *ReactionsListCall) Count(count int) *ReactionsListCall {
	c.count = count
	return c
}
1185826
func (s *RedisSetStore) Count(key string) (int, error) {
	if !strings.HasPrefix(key, s.prefix) {
		key = s.prefix + key
	}
	res, err := s.client.SCard(key).Result()
	return int(res), err
}
1242203
func (kv *KV) Count() (i int) {
	kv.db.View(func(txn *badger.Txn) error {
		opts := badger.DefaultIteratorOptions
		opts.PrefetchValues = false
		it := txn.NewIterator(opts)
		for it.Rewind(); it.Valid(); it.Next() {
			i++
		}
		it.Close()
		return nil
	})
	return
}
319068
func (query Query) Count() (int, error) {
	var out struct {
		Count int
	}

	err := query.Aggregate("count", "*", &out)
	return out.Count, err
}
623804
func (m *Manager) CountByUser(username string) (int, error) {
	qry := bson.M{"owners": username}
	return m.collection.Find(qry).Count()
}
442166
func (r *ClientupdateService) Count() *ClientupdateCountCall {
	c := &ClientupdateCountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	return c
}