0

I am using Query.In in c# but i want to make query case insenstive ? Is there any way to make it case insensitive.

Query.In("subjects", new BsonArray(model.subjects))

I want query to match both "Maths" and math.

knowledgeseeker
  • 1,163
  • 4
  • 15
  • 32

1 Answers1

0

Did you try with a Regex? Probably not very efficient, but at least working:

db.collection.find( { "subjects" : { $regex : /yourString/i } } );

Also have a look at: How do I make case-insensitive queries on Mongodb?

Community
  • 1
  • 1
Bidou
  • 7,378
  • 9
  • 47
  • 70