Let's say we have a model as under
public class RSS
{
public string Id { get; set; }
public string QuestionID { get; set; }
public string QuestionTitle { get; set; }
public string QuestionDescription { get; set; }
public DateTime PublishDate { get; set; }
}
The below piece of code will filter data
public List<RSS> ReadRssFeed(IEnumerable<string> lstIDs)
{
var rssCollection = new List<RSS>();
using (var ds = new DocumentStore
{
Url = "http://localhost:8080",
DefaultDatabase = "CRUDDemo"
}.Initialize())
using (var session = ds.OpenSession())
{
//Find records whose question title starts with "NAudio"
session
.Query<RSS>()
.Where(rss=>rss.QuestionTitle.StartsWith("NAudio"))
.ToList()
.ForEach((e) => rssCollection.Add(e));
}
return rssCollection;
}