don't allow _id to be an array

This commit is contained in:
Aaron
2009-04-07 11:02:29 -04:00
parent f86715cb85
commit 56f8696909
2 changed files with 18 additions and 1 deletions

View File

@@ -322,6 +322,20 @@ namespace QueryTests {
}
};
class ArrayId : public ClientBase {
public:
~ArrayId() {
client().dropCollection( "querytests.ArrayId" );
}
void run() {
const char *ns = "querytests.ArrayId";
client().ensureIndex( ns, BSON( "_id" << 1 ) );
ASSERT( !error() );
client().insert( ns, fromjson( "{'_id':[1,2]}" ) );
ASSERT( error() );
}
};
class All : public UnitTest::Suite {
public:
All() {
@@ -338,6 +352,7 @@ namespace QueryTests {
add< TailableDelete >();
add< TailableInsertDelete >();
add< OplogReplayMode >();
add< ArrayId >();
}
};