Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Nosql RavdnDb自动索引_Nosql_Ravendb_Ravendb Studio - Fatal编程技术网

Nosql RavdnDb自动索引

Nosql RavdnDb自动索引,nosql,ravendb,ravendb-studio,Nosql,Ravendb,Ravendb Studio,我有RavdnDb版本4.0中的此型号: public class AppUser { public AppUser() { ActiveInApps = new Dictionary<string, ActiveApp>(); } public string Id { get; set; } public string PhoneNumber { get; set; } public Dictionary<str

我有RavdnDb版本4.0中的此型号:

public class AppUser
{
    public AppUser()
    {
        ActiveInApps = new Dictionary<string, ActiveApp>();
    }
    public string Id { get; set; }
    public string PhoneNumber { get; set; }
    public Dictionary<string, ActiveApp> ActiveInApps { get; set; }
}

public class ActiveApp
{
    public bool IsActive { get; set; } = true;
    public string FirstName { get; set; }
    public string LastName { get; set; }
    [JsonIgnore]
    public string DisplayName => $"{FirstName} {LastName}";
    public DateTimeOffset LastActivity { get; set; }
}
并尝试使用此查询:

    from AppUsers  as user
         where user.PhoneNumber > '92' 
              or user.ActiveInApps[].FirstName = 'test'
              or user.ActiveInApps[].LastName = 'test'
              or user.ActiveInApps[].UserName = 'test'
              or user.ActiveInApps[].SerialNumber = 'test'
              or user.ActiveInApps[].LastActivity = 'test'
RavenDb创建了一个自动索引


如何在RavenDb上查看生成的自动索引代码。 尝试此模式:

       let p = u.ActiveInApps.Select(x=>x.Value).FirstOrDefault(aia => aia.IsActive == true)

您使用的是哪个版本的RavenDB?它在4.0和早期版本中有所不同。版本4.0!谢谢
       let p = u.ActiveInApps.Select(x=>x.Value).FirstOrDefault(aia => aia.IsActive == true)