mongoframes/frames.py
def many(cls, filter=None, **kwargs):
        """Return a list of documents matching the filter"""
        from mongoframes.queries import Condition, Group, to_refs

        # Flatten the projection
        kwargs['projection'], references, subs = \
                cls._flatten_projection(
                    kwargs.get('projection', cls._default_projection)
                    )

        # Find the documents
        if isinstance(filter, (Condition, Group)):
            filter = filter.to_dict()

        documents = list(cls.get_collection().find(to_refs(filter), **kwargs))

        # Dereference the documents (if required)
        if references:
            cls._dereference(documents, references)

        # Add sub-frames to the documents (if required)
        if subs:
            cls._apply_sub_frames(documents, subs)

        return [cls(d) for d in documents]
Return a list of documents matching the filter
Return a list of documents matching the filter
Return a list of documents matching the filter
def many(cls, filter=None, **kwargs):
        from mongoframes.queries import Condition, Group, to_refs
        kwargs['projection'], references, subs = \
                cls._flatten_projection(
                    kwargs.get('projection', cls._default_projection)
                    )
        if isinstance(filter, (Condition, Group)):
            filter = filter.to_dict()
        documents = list(cls.get_collection().find(to_refs(filter), **kwargs))
        if references:
            cls._dereference(documents, references)
        if subs:
            cls._apply_sub_frames(documents, subs)
        return [cls(d) for d in documents]
def many ( cls , filter = None , ** kwargs ) : from mongoframes . queries import Condition , Group , to_refs kwargs [ 'projection' ] , references , subs = cls . _flatten_projection ( kwargs . get ( 'projection' , cls . _default_projection ) ) if isinstance ( filter , ( Condition , Group ) ) : filter = filter . to_dict ( ) documents = list ( cls . get_collection ( ) . find ( to_refs ( filter ) , ** kwargs ) ) if references : cls . _dereference ( documents , references ) if subs : cls . _apply_sub_frames ( documents , subs ) return [ cls ( d ) for d in documents ]
Return a list of documents matching the filter
Return a list of documents matching the filter
"""Return a list of documents matching the filter""" # Flatten the projection # Find the documents # Dereference the documents (if required) # Add sub-frames to the documents (if required)
cls
filter