File tree Expand file tree Collapse file tree 2 files changed +0
-17
lines changed Expand file tree Collapse file tree 2 files changed +0
-17
lines changed Original file line number Diff line number Diff line change @@ -369,9 +369,6 @@ def save(doc, opts={})
369
369
#
370
370
# @core insert insert-instance_method
371
371
def insert ( doc_or_docs , opts = { } )
372
- if name . start_with? ( "system." ) && name !~ /(\A system\. users)|(\A system\. indexes)/
373
- raise Mongo ::InvalidNSName , "cannot insert into system collections."
374
- end
375
372
doc_or_docs = [ doc_or_docs ] unless doc_or_docs . is_a? ( Array )
376
373
doc_or_docs . collect! { |doc | @pk_factory . create_pk ( doc ) }
377
374
write_concern = get_write_concern ( opts , self )
Original file line number Diff line number Diff line change @@ -1075,20 +1075,6 @@ def test_ensure_index_timeout
1075
1075
coll . ensure_index ( [ [ 'a' , 1 ] ] )
1076
1076
end
1077
1077
1078
- def test_insert_raises_exception_on_system_collection
1079
- collection = @@db [ "system.foo" ]
1080
- assert_raise Mongo ::InvalidNSName do
1081
- collection . insert ( { :a => 1 } )
1082
- end
1083
- end
1084
-
1085
- def test_save_raises_exception_on_system_collection
1086
- collection = @@db [ "system.foo" ]
1087
- assert_raise Mongo ::InvalidNSName do
1088
- collection . save ( { :a => 1 } )
1089
- end
1090
- end
1091
-
1092
1078
if @@version > '2.0.0'
1093
1079
def test_show_disk_loc
1094
1080
@@test . save ( { :a => 1 } )
You can’t perform that action at this time.
0 commit comments