This is the code I'm using now, how do I add the "ignore case" attribute?
DBObject query = new BasicDBObject("prop", value);
Thanks
解决方案
When I had the exact problem, I wasn't able to query by ignoring case. I ended up copy the value that I wanted to search normalizing it. In this case, you can create a new property and convert it to lower case and have an index on that.
EDIT:
DBObject ref = new BasicDBObject();
ref.put("myfield", Pattern.compile(".*myValue.*" , Pattern.CASE_INSENSITIVE));
DBCursor cur = coll.find(ref);
I wonder if that works?