(self, collection, selector={})
return None
Return one item from a collection

        Arguments:
        collection - collection to search

        Keyword Arguments:
        selector - the query (default returns first item found)
Return one item from a collection
Return one item from a collection
def find_one(self, collection, selector={}):
        """Return one item from a collection

        Arguments:
        collection - collection to search

        Keyword Arguments:
        selector - the query (default returns first item found)"""
        for _id, doc in self.collection_data.data.get(collection, {}).items():
            doc.update({'_id': _id})
            if selector == {}:
                return doc
            for key, value in selector.items():
                if key in doc and doc[key] == value:
                    return doc
        return None
def find_one ( self , collection , selector = { } ) : for _id , doc in self . collection_data . data . get ( collection , { } ) . items ( ) : doc . update ( { '_id' : _id } ) if selector == { } : return doc for key , value in selector . items ( ) : if key in doc and doc [ key ] == value : return doc return None