I'm wondering if there is a way to specify the field name in a find
by passing in a variable. So instead of doing:
db.myCollection.find({fieldName = 123})
doing something like this:
var myVar = "fieldName";
db.myCollection.find({myVar: 123})
I get that this is a weird thing to do, but i'd like to know if this can be done and if so - how?