new implementation for the bson json comparator