It seems that keys and values in MongoDB and Perl are treated differently. Same string as key and val is saved differently.