(self, collection, selector={})
return results
Find data in a collection

        Arguments:
        collection - collection to search

        Keyword Arguments:
        selector - the query (default returns all items in a collection)
Find data in a collection
Find data in a collection
def find(self, collection, selector={}):
        """Find data in a collection

        Arguments:
        collection - collection to search

        Keyword Arguments:
        selector - the query (default returns all items in a collection)"""
        results = []
        for _id, doc in self.collection_data.data.get(collection, {}).items():
            doc.update({'_id': _id})
            if selector == {}:
                results.append(doc)
            for key, value in selector.items():
                if key in doc and doc[key] == value:
                    results.append(doc)
        return results
def find ( self , collection , selector = { } ) : results = [ ] for _id , doc in self . collection_data . data . get ( collection , { } ) . items ( ) : doc . update ( { '_id' : _id } ) if selector == { } : results . append ( doc ) for key , value in selector . items ( ) : if key in doc and doc [ key ] == value : results . append ( doc ) return results