You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
541 B
C#
21 lines
541 B
C#
using MongoDB.Driver;
|
|
|
|
namespace Ds.WMS.MogonDb
|
|
{
|
|
public class MogonDbHelper
|
|
{
|
|
public void inerst()
|
|
{
|
|
var client = new MongoClient("mongodb://{MongoDB}:27017");
|
|
IMongoDatabase database = client.GetDatabase("Test");
|
|
database.CreateCollection("Test");
|
|
var collection1 = database.GetCollection<Test1>("Test");
|
|
collection1.InsertOne(new Test1 { Name = "Test1" });
|
|
}
|
|
}
|
|
|
|
public class Test1
|
|
{
|
|
public string Name { get; set; }
|
|
}
|
|
} |