Example:
> db.stuff.save({\"foo\":\"bar\"}); > db.stuff.find({\"foo\":\"bar\"}).count(); 1 > db.stuff.find({\"foo\":\"BAR\"}).count(); 0
Use RegExp, In case if any other options do not work for you, RegExp is a good option. It makes the string case insensitive.
var username = new RegExp("^" + "John" + "$", "i");;
use username in queries, and then its done.
I hope it will work for you too. All the Best.