Skip to content

Commit 904af6b

Browse files
committed
SERVER-14378: require _id for all but a few system collections
1 parent 8b2cee4 commit 904af6b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/mongo/db/catalog/collection.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,12 @@ namespace mongo {
100100
}
101101

102102
if ( _ns.isSystem() ) {
103-
return false;
103+
StringData shortName = _ns.coll().substr( _ns.coll().find( '.' ) + 1 );
104+
if ( shortName == "indexes" ||
105+
shortName == "namespaces" ||
106+
shortName == "profile" ) {
107+
return false;
108+
}
104109
}
105110

106111
if ( _ns.db() == "local" ) {

0 commit comments

Comments
 (0)