Hibernating Rhinos Ltd
Oren Eini l CEO l Mobile: + 972-52-548-6969
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
public class Products_ByAttribute : AbstractIndexCreationTask<Product> { public class Result { public string Color { get; set; } } ...
void Main(){MyCustomDataClass mcdc = new MyCustomDataClass();mcdc.Name = "First Test";mcdc.CustomData.Add("Color", "Avocado");mcdc.CustomData.Add("Price", 125.00);var store = new Raven.Client.Document.DocumentStore{Url = "http://localhost:8889",DefaultDatabase = "Playground_Robb"};store.Initialize();new MyCustomClass_ByAttribute().Execute(store);using (var session = OpenSession()){// session.Store(mcdc);// session.SaveChanges();IList<MyCustomDataClass> results = session.Advanced.DocumentQuery<MyCustomDataClass, MyCustomClass_ByAttribute>().WhereEquals("Price", 125.00).ToList();results.Dump();}}// Define other methods and classes herepublic class MyCustomDataClass{public int Id { get; set; }public string Name { get; set; }public Dictionary<string, object> CustomData { get; set; } = new Dictionary<string, object>();}public class MyCustomClass_ByAttribute : AbstractIndexCreationTask<MyCustomDataClass>{public class Result{public string Color { get; set; }}public MyCustomClass_ByAttribute(){Map = products => from p in productsselect new{_ = p.CustomData.Select(attribute =>CreateField(attribute.Key, attribute.Value, false, true))};}}
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.