Skip to content

Commit

Permalink
Rename MetaData propertys to Metadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
lanwin committed Jun 20, 2010
1 parent 0ca7fb4 commit ab343f8
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion source/MongoDB.GridFS/GridFile.cs
Expand Up @@ -55,7 +55,7 @@ public IMongoCollection Chunks
this.db = db;
this.files = db[bucket + ".files"];
this.chunks = db[bucket + ".chunks"];
this.chunks.MetaData.CreateIndex(new Document().Add("files_id", 1).Add("n", 1), true);
this.chunks.Metadata.CreateIndex(new Document().Add("files_id", 1).Add("n", 1), true);
this.name = bucket;
}

Expand Down
12 changes: 6 additions & 6 deletions source/MongoDB.Tests/IntegrationTests/TestCollectionMetaData.cs
Expand Up @@ -33,14 +33,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);
Expand All @@ -52,23 +52,23 @@ 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"]);
}

[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_"]);
}

[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"]);
Expand All @@ -80,7 +80,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");
Expand Down
Expand Up @@ -67,7 +67,7 @@ public class TestCollectionSafeMode : MongoTestBase
protected IMongoCollection InitCollection(string name)
{
IMongoCollection col = DB[name];
col.MetaData.CreateIndex(new Document{{"x", IndexOrder.Ascending}}, true);
col.Metadata.CreateIndex(new Document{{"x", IndexOrder.Ascending}}, true);
for(int x = 0; x < 5; x++){
col.Insert(new Document{{"x", x}, {"y", 1}});
}
Expand Down
2 changes: 1 addition & 1 deletion source/MongoDB.Tests/IntegrationTests/TestCursor.cs
Expand Up @@ -113,7 +113,7 @@ public void TestHint()
var exp = reads.FindAll().Hint(hint).Explain();
Assert.IsTrue(exp.Contains("$err"), "No error found");

reads.MetaData.CreateIndex("hintindex", hint, false);
reads.Metadata.CreateIndex("hintindex", hint, false);
exp = reads.FindAll().Hint(hint).Explain();

Assert.IsTrue(exp.Contains("cursor"));
Expand Down
4 changes: 2 additions & 2 deletions source/MongoDB.Tests/IntegrationTests/TestDatabase.cs
Expand Up @@ -72,7 +72,7 @@ public class TestDatabase : MongoTestBase
[Test]
public void TestGetLastError(){
var errcol = DB["errcol"];
errcol.MetaData.CreateIndex(new Document {{"x", IndexOrder.Ascending}}, true);
errcol.Metadata.CreateIndex(new Document {{"x", IndexOrder.Ascending}}, true);
var dup = new Document {{"x", 1}, {"y", 2}};
errcol.Insert(dup);
var error = DB.GetLastError();
Expand All @@ -94,7 +94,7 @@ public class TestDatabase : MongoTestBase
[Test]
public void TestGetPrevError(){
var col = DB["preverror"];
col.MetaData.CreateIndex(new Document {{"x", IndexOrder.Ascending}}, true);
col.Metadata.CreateIndex(new Document {{"x", IndexOrder.Ascending}}, true);
var docs = new List<Document>();
for(var x = 0; x < 10; x++)
docs.Add(new Document {{"x", x}, {"y", 2}});
Expand Down
2 changes: 1 addition & 1 deletion source/MongoDB/DatabaseJavascript.cs
Expand Up @@ -34,7 +34,7 @@ internal DatabaseJavascript(IMongoDatabase database)
/// </remarks>
private void EnsureIndexExists()
{
_collection.MetaData.CreateIndex(new Document("_id", 1), true);
_collection.Metadata.CreateIndex(new Document("_id", 1), true);
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion source/MongoDB/IMongoCollection_1.cs
Expand Up @@ -38,7 +38,7 @@ public interface IMongoCollection<T>
/// <summary>
/// Metadata about the collection such as indexes.
/// </summary>
CollectionMetadata MetaData { get; }
CollectionMetadata Metadata { get; }

/// <summary>
/// Finds and returns the first document in a selector query.
Expand Down
6 changes: 3 additions & 3 deletions source/MongoDB/MongoCollection_1.cs
Expand Up @@ -18,7 +18,7 @@ public class MongoCollection<T> : IMongoCollection<T> where T : class
private readonly MongoConfiguration _configuration;
private readonly Connection _connection;
private MongoDatabase _database;
private CollectionMetadata _metaData;
private CollectionMetadata _metadata;

/// <summary>
/// Initializes a new instance of the <see cref="MongoCollection&lt;T&gt;"/> class.
Expand Down Expand Up @@ -68,8 +68,8 @@ internal MongoCollection(MongoConfiguration configuration, Connection connection
/// Gets the meta data.
/// </summary>
/// <value>The meta data.</value>
public CollectionMetadata MetaData {
get { return _metaData ?? (_metaData = new CollectionMetadata(_configuration, DatabaseName, Name, _connection)); }
public CollectionMetadata Metadata {
get { return _metadata ?? (_metadata = new CollectionMetadata(_configuration, DatabaseName, Name, _connection)); }
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion source/MongoDB/Obsolete/IMongoCollection.cs
Expand Up @@ -36,7 +36,7 @@ public interface IMongoCollection
/// Gets the meta data.
/// </summary>
/// <value>The meta data.</value>
CollectionMetadata MetaData { get; }
CollectionMetadata Metadata { get; }

/// <summary>
/// Finds the one.
Expand Down
4 changes: 2 additions & 2 deletions source/MongoDB/Obsolete/MongoCollection.cs
Expand Up @@ -64,9 +64,9 @@ public string FullName
/// Gets the meta data.
/// </summary>
/// <value>The meta data.</value>
public CollectionMetadata MetaData
public CollectionMetadata Metadata
{
get { return _collection.MetaData; }
get { return _collection.Metadata; }
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion tools/Benchmark/Main.cs
Expand Up @@ -128,7 +128,7 @@ private static void SetupInsert(IMongoDatabase db, string col, bool index)
if(index)
{
var idx = new Document().Add("x", IndexOrder.Ascending);
db[col].MetaData.CreateIndex(idx, false);
db[col].Metadata.CreateIndex(idx, false);
}
}
catch(MongoCommandException)
Expand Down

0 comments on commit ab343f8

Please sign in to comment.