Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated input validation so collections with periods like system.inde…

…xes can be used with the driver to do things like create ensure indexes.
  • Loading branch information...
commit 49096eb4ec89448e58f5c33ae42e7158627b55a3 1 parent 2cd158f
@s9tpepper authored
View
BIN  builds/MongoAS3_v.0.3.swc
Binary file not shown
View
3  src/as3/mongo/db/DBMethodInputValidator.as
@@ -23,9 +23,6 @@ package as3.mongo.db
{
if (null == collectionName || "" == collectionName)
throw new MongoError(MongoError.COLLECTION_NAME_MAY_NOT_BE_NULL_OR_EMPTY);
-
- if (collectionName.lastIndexOf(".") > -1)
- throw new MongoError(MongoError.INVALID_COLLECTION_NAME_CONTAINS_PERIOD);
}
public static function canAuthenticate(db:DB):Boolean
View
2  tests-src/flexUnitTests/as3/mongo/db/DBMethodInputValidatorTests.as
@@ -51,6 +51,8 @@ package flexUnitTests.as3.mongo.db
DBMethodInputValidator.checkForInvalidCollectionNames("");
}
+ [Deprecated(message = "This test is deprecated as of version 0.3. Periods in collection names are needed to access collections like 'system.indexes'.")]
+ [Ignore]
[Test(expects = "as3.mongo.error.MongoError")]
public function checkForInvalidCollectionNames_inputHasPeriod_throwsMongoError():void
{
View
2  tests-src/flexUnitTests/as3/mongo/db/DB_findTests.as
@@ -108,6 +108,8 @@ package flexUnitTests.as3.mongo.db
_db.find(null, new Document(), new FindOptions());
}
+ [Deprecated(message = "This test is deprecated as of version 0.3. Periods in collection names are needed to access collections like 'system.indexes'.")]
+ [Ignore]
[Test(expects = "as3.mongo.error.MongoError")]
public function find_invalidCollectionNameWithPeriod_throwsError():void
{
View
2  tests-src/flexUnitTests/as3/mongo/db/DB_updateFirstTests.as
@@ -45,6 +45,8 @@ package flexUnitTests.as3.mongo.db
assertThat(mockWire, received().method("updateFirst").args(_testDBName, testCollectionName, selector, update).once());
}
+ [Deprecated(message = "This test is deprecated as of version 0.3. Periods in collection names are needed to access collections like 'system.indexes'.")]
+ [Ignore]
[Test(expects = "as3.mongo.error.MongoError")]
public function updateFirst_invalidCollectionNameContainsPeriod_throwsError():void
{
View
2  tests-src/flexUnitTests/as3/mongo/db/DB_updateTests.as
@@ -53,6 +53,8 @@ package flexUnitTests.as3.mongo.db
_db.update(null, new Document(), new Document());
}
+ [Deprecated(message = "This test is deprecated as of version 0.3. Periods in collection names are needed to access collections like 'system.indexes'.")]
+ [Ignore]
[Test(expects = "as3.mongo.error.MongoError")]
public function update_invalidCollectionNameWithPeriodInIt_throwsError():void
{
View
2  tests-src/flexUnitTests/as3/mongo/db/DB_upsertTests.as
@@ -53,6 +53,8 @@ package flexUnitTests.as3.mongo.db
_db.upsert(null, new Document(), new Document());
}
+ [Deprecated(message = "This test is deprecated as of version 0.3. Periods in collection names are needed to access collections like 'system.indexes'.")]
+ [Ignore]
[Test(expects = "as3.mongo.error.MongoError")]
public function upsert_invalidCollectionNameWithPeriod_throwsError():void
{
Please sign in to comment.
Something went wrong with that request. Please try again.