I have a BsonDocument like
{
"Code" : "123ACThe three $#^",
. . . .
}
I want to find the records which is having 3AC anywhere in the string in the field Code
note :- the characers AC should be case insensitive
I am new to mongoDb.How to achieve this ? Thanks in Advance for replies.
UPDATE
I tried this code db.session.find({ "Code": { "$regex": '^(.?(\b3AC\b)[^$])$' } } );
Got this working
db.session.find({ "Code": { "$regex": '3AC.*'} } );
Is this the only way ? and how to achieve in C# using native driver ?