var query = from customer in session.Query<Individual>() where customer.Id == $"individuals/{id}" select new PhoneListModel { CustomerName = customer.Name, Phones = from phone in customer.Phones select new PhoneModel { Label = phone.Key, Prefix = phone.Value.CountryPrefix, Phone = phone.Value.Value } };from Individuals as customerwhere id() = $p0select{ CustomerName : customer.Name, Phones : customer.Phones.map(function(phone) { return { Label:phone.Key, Prefix:phone.Value.CountryPrefix, Phone:phone.Value.Value }; })}limit $p1, $p2
"Phones": { "Home": { "CountryPrefix": "0034", "Value": "612345678" },
"Work": {
"CountryPrefix": "0034", "Value": "961234567" }},var query = from customer in data.Query<Individual>() where customer.Id == $"individuals/{individualId}" select new { Name = customer.FirstName, Phone = (from phone in customer.Phones where phone.Key == phoneLabel select phone).FirstOrDefault() };--
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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/320c5387-aa6f-4257-b5d0-a3b4a022a774%40googlegroups.com.
What are your class models? What is the type of PhoneListModel.Phone ?
class PhoneModel
{
public string Label { get; set; }
public string Prefix { get; set; }
public string Value { get; set; }
}
class PhoneListModel{ public string CustomerName { get; set; } public IEnumerable<PhoneModel> Phones { get; set; }}I found a bug when I was trying to reproduce your issue
https://issues.hibernatingrhinos.com/issue/RavenDB_14269
To unsubscribe from this group and stop receiving emails from it, send an email to rav...@googlegroups.com.
![]() | Grisha Kotler Team Leader / Hibernating Rhinos LTD
|
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/917317e9-ed95-4734-8cb3-4b22a84530ed%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/917317e9-ed95-4734-8cb3-4b22a84530ed%40googlegroups.com.