'Wrapper around collection .find_one() method, depending on
pymongo version.'

@property
def find_one(self):

    try:
        return self._find_one
    except AttributeError:
        if (pymongo.version_tuple[0] > 2):
            def _find_one(colname, *args, **kargs):
                if ('spec_or_id' in kargs):
                    kargs['filter_or_id'] = kargs.pop('spec_or_id')
                if ('fields' in kargs):
                    kargs['projection'] = kargs.pop('fields')
                return self.db[colname].find_one(*args, **kargs)
            self._find_one = _find_one
        else:
            def _find_one(colname, *args, **kargs):
                return self.db[colname].find_one(*args, **kargs)
            self._find_one = _find_one
        return self._find_one
