fix lookup replacement to work for arrays and strings, open config for MongoDb