add count api for mongodb.

add count api for mongodb.