如何在dotnet Core中加入Mongo Collection

时间:2019-02-20 11:38:25

标签: mongodb .net-core asp.net-core-webapi asp.net-core-2.1

我想加入集合我的.net核心项目。我没有在项目中使用模型类。我正在使用 MongoDB.Driver 连接数据库。我正在使用以下代码从集合中检索数据。

var Collection1 = _database.GetCollection<BsonDocument>("collection1");
var Collection2 = _database.GetCollection<BsonDocument>("collection2");
var reportdoc = Collection1 .Find(new BsonDocument()).ToEnumerable();
var folderdoc = Collection2 .Find(new BsonDocument()).ToEnumerable();

我该怎么办。任何人都可以帮助我。

谢谢...

0 个答案:

没有答案