add count api for mongodb and it's verified.

Dear Fred,

I had fixed a but for count api, now it's work for me.

Cheers,
Wesley