Try Playground
Show / Hide Table of Contents

Method GetKeysByTag

GetKeysByTag(Tag)

Gets all keys of the objects with the specified tag.

Declaration
ICollection<string> GetKeysByTag(Tag tag)
Parameters
Type Name Description
Tag tag

The tag to search the cache with.

Returns
Type Description
System.Collections.Generic.ICollection<System.String>

Returns collection containing the cache keys.

Examples

The following example demonstrates how to get the keys with the specified tag.

ICache cache = CacheManager.GetCache("demoCache");
Tag tag = new Tag("Sports");
ICollection<string> keys = cache.SearchService.GetKeysByTag(tag);

GetKeysByTag(String)

Gets all the keys with the wild card supported tag.

Declaration
ICollection<string> GetKeysByTag(string wildCardExpression)
Parameters
Type Name Description
System.String wildCardExpression

The wild card expression to search with.

Returns
Type Description
System.Collections.Generic.ICollection<System.String>

Returns collection containing the cache keys.

Remarks

The special characters supported in wild search by NCache are:
1) "*" : Used as a substitute for zero or more characters in the string.
2) "?" : Used as a substitute for a single character in the string.

Examples

The following example demonstrates how to get the keys with the specified tag using wildcard.

ICache cache = CacheManager.GetCache("demoCache");

Following tags are created and items are added in the cache with these tags

Tag[] tags = new Tag[3];
tags[0] = new Tag("Important Customers");
tags[1] = new Tag("East Coast Customers");
tags[2] = new Tag("West Coast Customers");

ICollection<string> keys = cache.SearchService.GetKeysByTag("*Customers");
In This Article
  • GetKeysByTag(Tag)
  • GetKeysByTag(String)

Contact Us

PHONE

+1 (214) 764-6933   (US)

+44 20 7993 8327   (UK)

 
EMAIL

sales@alachisoft.com

support@alachisoft.com

NCache
  • NCache Enterprise
  • NCache Professional
  • Edition Comparison
  • NCache Architecture
  • Benchmarks
Download
Pricing
Try Playground

Deployments
  • Cloud (SaaS & Software)
  • On-Premises
  • Kubernetes
  • Docker
Technical Use Cases
  • ASP.NET Sessions
  • ASP.NET Core Sessions
  • Pub/Sub Messaging
  • Real-Time ASP.NET SignalR
  • Internet of Things (IoT)
  • NoSQL Database
  • Stream Processing
  • Microservices
Resources
  • Magazine Articles
  • Third-Party Articles
  • Articles
  • Videos
  • Whitepapers
  • Shows
  • Talks
  • Blogs
  • Docs
Customer Case Studies
  • Testimonials
  • Customers
Support
  • Schedule a Demo
  • Forum (Google Groups)
  • Tips
Company
  • Leadership
  • Partners
  • News
  • Events
  • Careers
Contact Us

  • EnglishChinese (Simplified)FrenchGermanItalianJapaneseKoreanPortugueseSpanish

  • Contact Us
  •  
  • Sitemap
  •  
  • Terms of Use
  •  
  • Privacy Policy
� Copyright Alachisoft 2002 - 2025. All rights reserved. NCache is a registered trademark of Diyatech Corp.
Back to top