Added support for mongodb index

Mainly to let mers to handle the dup error.