.Net Core在MongoDB中插入BsonDocument后获得响应

时间:2018-11-24 10:36:50

标签: c# mongodb asp.net-core .net-core

我想在Moongodb中插入数据后获得Response或ObjcetID。基于响应我想发送响应。我正在插入下面的代码。

try
  {
     BsonDocument Document = BsonDocument.Parse(value.ToString());
     _database.GetCollection<BsonDocument>("test").InsertOne(Document);
  }
  catch(Exception Ex)
  {
     Console.WriteLine(Ex.StackTrace);
  }

任何人请尝试帮助我。 谢谢...

0 个答案:

没有答案