Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (47.6k points)

Example:

> db.stuff.save({"foo":"bar"}); 

> db.stuff.find({"foo":"bar"}).count(); 

> db.stuff.find({"foo":"BAR"}).count();

0

1 Answer

0 votes
by (106k points)

Yes, it is possible to make a case-insensitive query for that you can use a regex.

Example code for that is as follows:-

db.stuff.find( { foo: /^bar$/i } );

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Mar 15, 2020 in Web Technology by ashely (50.2k points)
0 votes
2 answers
asked Oct 16, 2019 in Web Technology by Sammy (47.6k points)

Browse Categories

...