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={})
369369 #
370370 # @core insert insert-instance_method
371371 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
375372 doc_or_docs = [ doc_or_docs ] unless doc_or_docs . is_a? ( Array )
376373 doc_or_docs . collect! { |doc | @pk_factory . create_pk ( doc ) }
377374 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
10751075 coll . ensure_index ( [ [ 'a' , 1 ] ] )
10761076 end
10771077
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-
10921078 if @@version > '2.0.0'
10931079 def test_show_disk_loc
10941080 @@test . save ( { :a => 1 } )
You can’t perform that action at this time.
0 commit comments