本文整理汇总了C#中MongoCollection.Drop方法的典型用法代码示例。如果您正苦于以下问题:C# MongoCollection.Drop方法的具体用法?C# MongoCollection.Drop怎么用?C# MongoCollection.Drop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MongoCollection
的用法示例。
在下文中一共展示了MongoCollection.Drop方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestFixtureSetup
public void TestFixtureSetup()
{
server = MongoServer.Create("mongodb://localhost/?safe=true;slaveOk=true");
database = server["onlinetests"];
collection = database.GetCollection<C>("test");
collection.Drop();
}
示例2: TestFixtureSetup
public void TestFixtureSetup()
{
_server = Configuration.TestServer;
_database = Configuration.TestDatabase;
_collection = Configuration.TestCollection;
_collection.Drop();
}
示例3: TestFixtureSetup
public void TestFixtureSetup()
{
_server = MongoServer.Create("mongodb://localhost/?safe=true");
_database = _server["onlinetests"];
_collection = _database.GetCollection<GDA>("testcollection");
_collection.Drop();
}
示例4: TestFixtureSetup
public void TestFixtureSetup()
{
_database = Configuration.TestDatabase;
var collectionSettings = new MongoCollectionSettings() { GuidRepresentation = GuidRepresentation.Standard };
_collection = _database.GetCollection<C>("csharp714", collectionSettings);
_collection.Drop();
}
示例5: TestFixtureSetup
public void TestFixtureSetup()
{
server = MongoServer.Create("mongodb://localhost/?safe=true");
database = server["onlinetests"];
collection = database["testcollection"];
collection.Drop();
}
示例6: CSharp714Tests
public CSharp714Tests()
{
_database = LegacyTestConfiguration.Database;
var collectionSettings = new MongoCollectionSettings() { GuidRepresentation = GuidRepresentation.Standard };
_collection = _database.GetCollection<C>("csharp714", collectionSettings);
_collection.Drop();
}
示例7: CSharp840
public CSharp840()
{
_collection = LegacyTestConfiguration.GetCollection<BsonDocument>();
if (_collection.Exists()) { _collection.Drop(); }
_collection.Insert(new BsonDocument { { "x", 1 } });
_collection.Insert(new BsonDocument { { "x", 2 }, { "Length", BsonNull.Value } });
_collection.Insert(new BsonDocument { { "x", 3 }, { "Length", 123 } });
}
示例8: SetUp
public void SetUp()
{
_collection = Configuration.GetTestCollection<BsonDocument>();
if (_collection.Exists()) { _collection.Drop(); }
_collection.Insert(new BsonDocument { { "x", 1 } });
_collection.Insert(new BsonDocument { { "x", 2 }, { "Length", BsonNull.Value } });
_collection.Insert(new BsonDocument { { "x", 3 }, { "Length", 123 } });
}
示例9: Setup
public void Setup()
{
r = new PostRepository();
pb = new PostBuilder();
MongoSetup();
collection = database.GetCollection<Post>("posts");
collection.Drop();
}
示例10: MongoDbProcessManagerFinderTests
public MongoDbProcessManagerFinderTests()
{
_connectionString = "mongodb://localhost/";
_dbName = "ProcessManagerRepository";
var mongoClient = new MongoClient(_connectionString);
MongoServer server = mongoClient.GetServer();
MongoDatabase mongoDatabase = server.GetDatabase(_dbName);
_collection = mongoDatabase.GetCollection<TestData>("TestData");
_collection.Drop();
_mapper = new ProcessManagerPropertyMapper();
_mapper.ConfigureMapping<IProcessManagerData, Message>(m => m.CorrelationId, pm => pm.CorrelationId);
}
示例11: Setup
public void Setup()
{
_collection = LegacyTestConfiguration.GetCollection<B>();
_collection.Drop();
_collection.CreateIndex(new IndexKeysBuilder().Ascending("a", "b"), IndexOptions.SetName("i"));
_collection.CreateIndex(new IndexKeysBuilder().Ascending("a", "b"), IndexOptions.SetName("i"));
_collection.Insert(new B { Id = ObjectId.GenerateNewId(), a = 1, b = 10, c = 100 });
_collection.Insert(new B { Id = ObjectId.GenerateNewId(), a = 2, b = 20, c = 200 });
_collection.Insert(new B { Id = ObjectId.GenerateNewId(), a = 3, b = 30, c = 300 });
_collection.Insert(new B { Id = ObjectId.GenerateNewId(), a = 4, b = 40, c = 400 });
}
示例12: Setup
public void Setup()
{
_collection = LegacyTestConfiguration.GetCollection<B>();
_collection.Drop();
_collection.CreateIndex("Value", "SubValues.Value");
//numeric
_collection.Insert(new B { Id = ObjectId.GenerateNewId(), Value = (byte)1, SubValues = new List<C>() { new C(2f), new C(3), new C(4D), new C(5UL) } });
_collection.Insert(new B { Id = ObjectId.GenerateNewId(), Value = 2f, SubValues = new List<C>() { new C(6f), new C(7), new C(8D), new C(9UL) } });
//strings
_collection.Insert(new B { Id = ObjectId.GenerateNewId(), Value = "1", SubValues = new List<C>() { new C("2"), new C("3"), new C("4"), new C("5") } });
}
示例13: Context
public void Context()
{
var connectionStringUrl = new MongoUrl("mongodb://localhost/integration_tests");
MongoDatabase mongoDatabase = MongoDatabase.Create(connectionStringUrl);
mongoCollection = mongoDatabase.GetCollection("end_to_end_tests");
if(mongoCollection.Exists())
{
mongoCollection.Drop();
}
var elementWithIEnumerableProperty = new ElementWithIEnumerableProperty{Name = "Test", Objects = new List<object>{"Test value for serialization"}.Select(x =>x)};
mongoCollection.Insert(elementWithIEnumerableProperty);
}
示例14: Setup
public void Setup()
{
server = MongoServer.Create("mongodb://localhost/?safe=true");
server.Connect();
database = server["onlinetests"];
collection = database.GetCollection<C>("linqtests");
collection.Drop();
collection.Insert(new C { X = 1, Y = 11 });
collection.Insert(new C { X = 2, Y = 12 });
collection.Insert(new C { X = 3, Y = 13 });
collection.Insert(new C { X = 4, Y = 14 });
collection.Insert(new C { X = 5, Y = 15 });
}
示例15: Setup
public void Setup()
{
_server = Configuration.TestServer;
_server.Connect();
_database = Configuration.TestDatabase;
_collection = Configuration.GetTestCollection<C>();
_collection.Drop();
_collection.Insert(new C { X = 1, Y = 11 });
_collection.Insert(new C { X = 2, Y = 12 });
_collection.Insert(new C { X = 3, Y = 13 });
_collection.Insert(new C { X = 4, Y = 14 });
_collection.Insert(new C { X = 5, Y = 15 });
}