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



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

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


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
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)
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers


94k users

Browse Categories