test for mongodb
trimmed code