void test() { auto db = connectRedis("127.0.0.1").getDatabase(0); auto user_groups = RedisSetCollection!(string, RedisCollectionOptions.none)(db, "user_groups"); // add some groups for user with ID 0 user_groups[0].insert("cooking"); user_groups[0].insert("hiking"); // add some groups for user with ID 1 user_groups[1].insert("coding"); assert(user_groups[0].contains("hiking")); assert(!user_groups[0].contains("coding")); assert(user_groups[1].contains("coding")); user_groups[0].remove("hiking"); assert(!user_groups[0].contains("hiking")); }
Models a strongly typed numbered set of values.