1. Using Ruby but it also works on C# and likely other drivers.
2. File called repro.rb contains the following code:
require 'bundler/inline'
|
gemfile do
|
source 'https://rubygems.org'
|
gem 'mongo'
|
end
|
Mongo::Logger.logger.level = Logger::DEBUG
|
client = Mongo::Client.new('mongodb://127.0.0.1/test')
|
collection = client[:foo]
|
puts collection.find( { rubyprogramtestRegexWihtM: /(?-i)AA_/im } ).first
|
3. File called repro2.rb contains the following code:
require 'bundler/inline'
|
gemfile do
|
source 'https://rubygems.org'
|
gem 'mongo'
|
end
|
Mongo::Logger.logger.level = Logger::DEBUG
|
client = Mongo::Client.new('mongodb://127.0.0.1/test')
|
collection = client[:foo]
|
puts collection.find( { rubyprogramtestRegexWihtoutM: /(?-i)AA_/i } ).first
|
— Steps to reproduce —
#lauching mongodb*
mlaunch --single
#setting profiler to 2
mongo localhost/test --eval "db.setProfilingLevel(2)"
#executing first repro, please note we are specifyng /im here
ruby repro.rb
#attempt to read the system.profile()
mongo localhost/test --eval "db.system.profile.find()"
Expected error: Error: Error: SyntaxError: invalid regular expression flag s
#dumping the system.profile collection:
mongoexport -d test -c system.profile | grep rubyprogramtestRegexWihtM
#cleaning the system profile collection for a new test without /m*
mongo localhost/test --eval "db.setProfilingLevel(0); db.system.profile.drop();db.setProfilingLevel(2);"
#executing the second test without specifying /m*
ruby repro2.rb
#attempt to read the system.profile()
mongo localhost/test --eval "db.system.profile.find()"
expected error: Error: invalid regexp group
#dumping the system.profile collection:
mongoexport -d test -c system.profile | grep rubyprogramtestRegexWihtoutM