Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix some warnings.

  • Loading branch information...
commit 4a0cc9b2e33a13ce43f80f500516aa7198674d04 1 parent a19dfb5
@lanwin lanwin authored
View
6 MongoDB.Driver.Benchmark/Main.cs
@@ -28,7 +28,7 @@ public static void Main (string[] args)
m.Connect();
MongoDatabase db = m["benchmark"];
- db.MetaData.DropDatabase();
+ db.Metadata.DropDatabase();
Console.WriteLine("Starting Tests");
RunEncodeTest("encode (small)",small);
@@ -39,7 +39,7 @@ public static void Main (string[] args)
RunDecodeTest("decode (medium)", medium);
RunDecodeTest("decode (large)", large);
- db.MetaData.DropDatabase();
+ db.Metadata.DropDatabase();
RunInsertTest("insert (small, no index)", db, "small_none",small,false,false);
RunInsertTest("insert (medium, no index)", db, "medium_none",medium,false,false);
RunInsertTest("insert (large, no index)", db, "large_none",large,false,false);
@@ -117,7 +117,7 @@ public static void Main (string[] args)
static void SetupInsert(MongoDatabase db, string col, bool index){
try{
- db.MetaData.DropCollection(col);
+ db.Metadata.DropCollection(col);
if(index){
Document idx = new Document().Add("x", IndexOrder.Ascending);
db[col].MetaData.CreateIndex(idx,false);
View
6 MongoDB.GridFS/GridFileStream.cs
@@ -1,6 +1,4 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
+using System;
using System.IO;
using MongoDB.Driver;
@@ -197,7 +195,7 @@ private void ValidateReadState (byte[] array, int offset, int count)
/// <summary>
/// Copies from the source array into the grid file.
/// </summary>
- /// <param name="array">A <see cref="System.Byte[]"/> The source array to copy from.</param>
+ /// <param name="array">The array.</param>
/// <param name="offset">A <see cref="System.Int32"/> The offset within the source array.</param>
/// <param name="count">A <see cref="System.Int32"/> The number of bytes from within the source array to copy.</param>
public override void Write (byte[] array, int offset, int count)
View
12 MongoDB.Net-Tests/TestAuthentication.cs
@@ -26,12 +26,12 @@ public void SetUp()
mongo.Connect();
var testDatabase = mongo[testDatabaseName];
- if(testDatabase.MetaData.FindUser(testuser) == null)
- testDatabase.MetaData.AddUser(testuser, testpass);
+ if(testDatabase.Metadata.FindUser(testuser) == null)
+ testDatabase.Metadata.AddUser(testuser, testpass);
var adminDatabase = mongo["admin"];
- if(adminDatabase.MetaData.FindUser(adminuser) == null)
- adminDatabase.MetaData.AddUser(adminuser, adminpass);
+ if(adminDatabase.Metadata.FindUser(adminuser) == null)
+ adminDatabase.Metadata.AddUser(adminuser, adminpass);
}
}
@@ -108,8 +108,8 @@ private static void TryInsertData(Mongo mongo)
*/
using(var mongo = ConnectAndAuthenticatedMongo(adminuser, adminuser))
{
- mongo[testDatabaseName].MetaData.RemoveUser(testuser);
- mongo["admin"].MetaData.RemoveUser(adminuser);
+ mongo[testDatabaseName].Metadata.RemoveUser(testuser);
+ mongo["admin"].Metadata.RemoveUser(adminuser);
}
// clean connections
View
12 MongoDB.Net-Tests/TestCollectionMetaData.cs
@@ -35,14 +35,14 @@ public class TestCollectionMetaData : MongoTestBase
[Test]
public void TestGetOptions(){
- CollectionMetaData cmd = DB["reads"].MetaData;
+ CollectionMetadata cmd = DB["reads"].MetaData;
Document options = cmd.Options;
Assert.IsNotNull(options);
}
[Test]
public void TestGetIndexes(){
- CollectionMetaData cmd = DB["indextests"].MetaData;
+ CollectionMetadata cmd = DB["indextests"].MetaData;
Dictionary<string, Document> indexes = cmd.Indexes;
Assert.IsNotNull(indexes);
@@ -54,7 +54,7 @@ public class TestCollectionMetaData : MongoTestBase
[Test]
public void TestCreateIndex(){
- CollectionMetaData cmd = DB["indextests"].MetaData;
+ CollectionMetadata cmd = DB["indextests"].MetaData;
cmd.CreateIndex("lastnames", new Document().Add("lname", IndexOrder.Ascending), false);
Dictionary<string, Document> indexes = cmd.Indexes;
Assert.IsNotNull(indexes["lastnames"]);
@@ -62,7 +62,7 @@ public class TestCollectionMetaData : MongoTestBase
[Test]
public void TestCreateIndexNoNames(){
- CollectionMetaData cmd = DB["indextests"].MetaData;
+ CollectionMetadata cmd = DB["indextests"].MetaData;
cmd.CreateIndex(new Document().Add("lname", IndexOrder.Ascending).Add("fname", IndexOrder.Ascending), true);
Dictionary<string, Document> indexes = cmd.Indexes;
Assert.IsNotNull(indexes["_lname_fname_unique_"]);
@@ -70,7 +70,7 @@ public class TestCollectionMetaData : MongoTestBase
[Test]
public void TestDropIndex(){
- CollectionMetaData cmd = DB["indextests"].MetaData;
+ CollectionMetadata cmd = DB["indextests"].MetaData;
cmd.CreateIndex("firstnames", new Document().Add("fname", IndexOrder.Ascending), false);
Dictionary<string, Document> indexes = cmd.Indexes;
Assert.IsNotNull(indexes["firstnames"]);
@@ -82,7 +82,7 @@ public class TestCollectionMetaData : MongoTestBase
public void TestRename(){
DB["rename"].Insert(new Document(){{"test", "rename"}});
Assert.AreEqual(1, DB["rename"].Count());
- CollectionMetaData cmd = DB["rename"].MetaData;
+ CollectionMetadata cmd = DB["rename"].MetaData;
cmd.Rename("renamed");
Assert.IsFalse(DB.GetCollectionNames().Contains(DB.Name + ".rename"), "Shouldn't have found collection");
Assert.IsTrue(DB.GetCollectionNames().Contains(DB.Name + ".renamed"),"Should have found collection");
View
10 MongoDB.Net-Tests/TestDatabaseMetaData.cs
@@ -21,7 +21,7 @@ public class TestDatabaseMetaData : MongoTestBase
[Test]
public void TestCreateCollectionNoOptions(){
- DB.MetaData.CreateCollection("creatednoopts");
+ DB.Metadata.CreateCollection("creatednoopts");
List<String> names = DB.GetCollectionNames();
Assert.IsTrue(names.Contains("tests.creatednoopts"));
@@ -31,7 +31,7 @@ public class TestDatabaseMetaData : MongoTestBase
[Test]
public void TestCreateCollectionWithOptions(){
Document options = new Document().Add("capped", true).Add("size", 10000);
- DB.MetaData.CreateCollection("createdcapped",options);
+ DB.Metadata.CreateCollection("createdcapped",options);
List<String> names = DB.GetCollectionNames();
Assert.IsTrue(names.Contains("tests.createdcapped"));
@@ -41,7 +41,7 @@ public class TestDatabaseMetaData : MongoTestBase
[Test]
public void TestCreateCollectionWithInvalidOptions(){
Document options = new Document().Add("invalidoption", true);
- DB.MetaData.CreateCollection("createdinvalid",options);
+ DB.Metadata.CreateCollection("createdinvalid",options);
List<String> names = DB.GetCollectionNames();
Assert.IsTrue(names.Contains("tests.createdinvalid"));
@@ -50,7 +50,7 @@ public class TestDatabaseMetaData : MongoTestBase
[Test]
public void TestDropCollection(){
- bool dropped = DB.MetaData.DropCollection("todrop");
+ bool dropped = DB.Metadata.DropCollection("todrop");
Assert.IsTrue(dropped,"Dropped was false");
@@ -63,7 +63,7 @@ public class TestDatabaseMetaData : MongoTestBase
public void TestDropInvalidCollection(){
bool thrown = false;
try{
- DB.MetaData.DropCollection("todrop_notexists");
+ DB.Metadata.DropCollection("todrop_notexists");
}catch(MongoCommandException){
thrown = true;
}
View
10 MongoDBDriver/CollectionMetaData.cs
@@ -9,7 +9,7 @@ namespace MongoDB.Driver
/// <summary>
/// Lazily loaded meta data on the collection.
/// </summary>
- public class CollectionMetaData
+ public class CollectionMetadata
{
private readonly MongoDatabase _database;
private readonly string _fullName;
@@ -19,13 +19,13 @@ public class CollectionMetaData
private Document _options;
/// <summary>
- /// Initializes a new instance of the <see cref="CollectionMetaData"/> class.
+ /// Initializes a new instance of the <see cref="CollectionMetadata"/> class.
/// </summary>
/// <param name="serializationFactory">The serialization factory.</param>
- /// <param name="databaseName">Name of the db.</param>
+ /// <param name="databaseName">Name of the database.</param>
/// <param name="name">The name.</param>
- /// <param name="connection">The conn.</param>
- public CollectionMetaData(ISerializationFactory serializationFactory, string databaseName, string name, Connection connection)
+ /// <param name="connection">The connection.</param>
+ public CollectionMetadata(ISerializationFactory serializationFactory, string databaseName, string name, Connection connection)
{
_fullName = databaseName + "." + name;
this._name = name;
View
6 MongoDBDriver/DatabaseMetaData.cs
@@ -6,7 +6,7 @@ namespace MongoDB.Driver
/// <summary>
/// Administration of metadata for a database.
/// </summary>
- public class DatabaseMetaData
+ public class DatabaseMetadata
{
private readonly Connection _connection;
private readonly MongoDatabase _database;
@@ -14,12 +14,12 @@ public class DatabaseMetaData
private readonly ISerializationFactory _serializationFactory;
/// <summary>
- /// Initializes a new instance of the <see cref = "DatabaseMetaData" /> class.
+ /// Initializes a new instance of the <see cref = "DatabaseMetadata" /> class.
/// </summary>
/// <param name = "serializationFactory">The serialization factory.</param>
/// <param name = "name">The name.</param>
/// <param name = "conn">The conn.</param>
- public DatabaseMetaData(ISerializationFactory serializationFactory, string name, Connection conn)
+ public DatabaseMetadata(ISerializationFactory serializationFactory, string name, Connection conn)
{
this._serializationFactory = serializationFactory;
_connection = conn;
View
2  MongoDBDriver/IMongoCollection.cs
@@ -29,7 +29,7 @@ public interface IMongoCollection {
/// Gets the meta data.
/// </summary>
/// <value>The meta data.</value>
- CollectionMetaData MetaData { get; }
+ CollectionMetadata MetaData { get; }
/// <summary>
/// Finds the one.
View
2  MongoDBDriver/IMongoCollection`1.cs
@@ -35,7 +35,7 @@ public interface IMongoCollection<T> where T : class
/// <summary>
/// Metadata about the collection such as indexes.
/// </summary>
- CollectionMetaData MetaData { get; }
+ CollectionMetadata MetaData { get; }
/// <summary>
/// Finds and returns the first document in a query.
View
2  MongoDBDriver/IMongoDatabase.cs
@@ -18,7 +18,7 @@ public interface IMongoDatabase
/// Gets the meta data.
/// </summary>
/// <value>The meta data.</value>
- DatabaseMetaData MetaData { get; }
+ DatabaseMetadata Metadata { get; }
/// <summary>
/// Gets the javascript.
View
2  MongoDBDriver/MapReduce.cs
@@ -195,7 +195,7 @@ public class MapReduce : IDisposable
return; //Nothing to do.
//Drop the temporary collection that was created as part of results.
- database.MetaData.DropCollection(Result.CollectionName);
+ database.Metadata.DropCollection(Result.CollectionName);
}
/// <summary>
View
2  MongoDBDriver/MongoCollection.cs
@@ -47,7 +47,7 @@ public class MongoCollection : IMongoCollection
/// Gets the meta data.
/// </summary>
/// <value>The meta data.</value>
- public CollectionMetaData MetaData {
+ public CollectionMetadata MetaData {
get { return _collection.MetaData; }
}
View
6 MongoDBDriver/MongoCollection`1.cs
@@ -14,7 +14,7 @@ public class MongoCollection<T> : IMongoCollection<T> where T : class
{
private readonly Connection _connection;
private MongoDatabase _database;
- private CollectionMetaData _metaData;
+ private CollectionMetadata _metaData;
private readonly ISerializationFactory _serializationFactory;
/// <summary>
@@ -65,8 +65,8 @@ public MongoCollection(ISerializationFactory serializationFactory, Connection co
/// Gets the meta data.
/// </summary>
/// <value>The meta data.</value>
- public CollectionMetaData MetaData {
- get { return _metaData ?? (_metaData = new CollectionMetaData(_serializationFactory, DatabaseName, Name, _connection)); }
+ public CollectionMetadata MetaData {
+ get { return _metaData ?? (_metaData = new CollectionMetadata(_serializationFactory, DatabaseName, Name, _connection)); }
}
/// <summary>
View
4 MongoDBDriver/MongoDB.Driver.csproj
@@ -85,7 +85,7 @@
<Compile Include="CommandResults\CommandResultBase.cs" />
<Compile Include="Connections\RawConnection.cs" />
<Compile Include="IMongoDatabase.cs" />
- <Compile Include="CollectionMetaData.cs" />
+ <Compile Include="CollectionMetadata.cs" />
<Compile Include="Connections\Connection.cs" />
<Compile Include="Connections\ConnectionFactory.cs" />
<Compile Include="Connections\ConnectionFactoryBase.cs" />
@@ -95,7 +95,7 @@
<Compile Include="Connections\SimpleConnectionFactory.cs" />
<Compile Include="AssemblyInfo.cs" />
<Compile Include="Bson\BsonWriter.cs" />
- <Compile Include="DatabaseMetaData.cs" />
+ <Compile Include="DatabaseMetadata.cs" />
<Compile Include="DBRef.cs" />
<Compile Include="Document.cs" />
<Compile Include="Exceptions\MongoCommandException.cs" />
View
6 MongoDBDriver/MongoDatabase.cs
@@ -18,7 +18,7 @@ public class MongoDatabase : IMongoDatabase
private readonly ISerializationFactory _serializationFactory;
private readonly Connection _connection;
private DatabaseJavascript _javascript;
- private DatabaseMetaData _metaData;
+ private DatabaseMetadata _metadata;
/// <summary>
/// Initializes a new instance of the <see cref="MongoDatabase"/> class.
@@ -57,8 +57,8 @@ public MongoDatabase(ISerializationFactory serializationFactory, Connection conn
/// Gets the meta data.
/// </summary>
/// <value>The meta data.</value>
- public DatabaseMetaData MetaData{
- get { return _metaData ?? (_metaData = new DatabaseMetaData(_serializationFactory, Name, _connection)); }
+ public DatabaseMetadata Metadata{
+ get { return _metadata ?? (_metadata = new DatabaseMetadata(_serializationFactory, Name, _connection)); }
}
/// <summary>
View
1  examples/SimpleVB/Application.vb
@@ -21,7 +21,6 @@ Namespace Simple
Public Shared Sub Main()
Dim app As New Application()
- Dim c As Collection
app.Setup()
app.Run()
Please sign in to comment.
Something went wrong with that request. Please try again.