C# 2个相关集合中的LiteDB查询
我有一个C# 2个相关集合中的LiteDB查询,c#,relationship,bson,dbref,litedb,C#,Relationship,Bson,Dbref,Litedb,我有一个LiteDB数据库,包含2个POCO类 包含“Id”和“Name”作为属性的作者 包含“标题”Id”和“作者”(此属性具有 bson参考作者收藏) 我正在尝试查询图书集合,以便检索所有名为“John”的作者,他们写了一本或多本书 class Author // collection "authors" { [BsonId] public int id {get; set;} public string Name{get; set;} } clas
LiteDB
数据库,包含2个POCO类- 包含“
”和“Id
”作为属性的作者Name
- 包含“
”标题
”和“Id
”(此属性具有作者
参考作者收藏)bson
John
”的作者,他们写了一本或多本书
class Author // collection "authors"
{
[BsonId]
public int id {get; set;}
public string Name{get; set;}
}
class Book //collection "books"
{
[BsonId]
public int id {get; set;}
public string Title{get; set;}
[BsonRef("authors")]
public Author author {get; set;}
}
谢谢你的帮助这里也解决了同样的问题。