This is an object to be processed:
var q = {
email: {contains: "noname@hotmail.com"},
name: {contains: "someuser"}
};
I would like to go through each key of q and if the corresponding value is an object that has the property contains
then replace it with $regex
.