File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
lib/mongo/operation/list_collections Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,11 @@ def execute(server)
4444
4545 private
4646
47+ def selector ( server )
48+ ( spec [ SELECTOR ] || { } ) . merge (
49+ listCollections : 1 , filter : { name : { '$not' => /system\. |\$ / } } )
50+ end
51+
4752 def message ( server )
4853 Protocol ::Msg . new ( flags , options , command ( server ) )
4954 end
Original file line number Diff line number Diff line change 200200 it 'returns collection objects for each name' do
201201 expect ( database . collections ) . to include ( collection )
202202 end
203+
204+ it 'does not include the system collections' do
205+ expect ( database . collections . collect ( &:name ) . none? { |name | name =~ /system\. |\$ / } ) . to be ( true )
206+ end
203207 end
204208
205209 context 'when the database does not exist' do
You can’t perform that action at this time.
0 commit comments