BB.Caching.Redis.Analytics.BitwiseAnalytics.Count C# (CSharp) Method

Count() public static method

Gets the count of active bits at the key supplied.
public static Count ( IDatabase database, RedisKey key, long eventId = -1 ) : long
database IDatabase /// The database where the query will be performed. This is passed so that we can reuse the same database to /// perform multiple bitwise operations. Doing this with the same connection will guarantee that performance /// is good. ///
key RedisKey /// The key. ///
eventId long /// You can optionally supply the id of the thing being interacted with, which will result in a count of either /// 0 or 1. ///
return long
        public static long Count(IDatabase database, RedisKey key, long eventId = -1)
        {
            if (eventId < 0)
            {
                return database.StringBitCount(key, 0, -1);
            }
            else
            {
                return database.StringGetBit(key, eventId) ? 1 : 0;
            }
        }

Same methods

BitwiseAnalytics::Count ( RedisKey key, long eventId = -1 ) : long