Now works with mongodb too