summaryrefslogtreecommitdiff
path: root/jstests/core/regex_options.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/regex_options.js')
-rw-r--r--jstests/core/regex_options.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/jstests/core/regex_options.js b/jstests/core/regex_options.js
new file mode 100644
index 00000000000..3febe2575ab
--- /dev/null
+++ b/jstests/core/regex_options.js
@@ -0,0 +1,7 @@
+t = db.jstests_regex_options;
+
+t.drop();
+t.save( { a: "foo" } );
+assert.eq( 1, t.count( { a: { "$regex": /O/i } } ) );
+assert.eq( 1, t.count( { a: /O/i } ) );
+assert.eq( 1, t.count( { a: { "$regex": "O", "$options": "i" } } ) );