def create_where_clause(self, kwargs, from_gridfs = False):
        '''
        Create where clause from `kwargs`.

        Parameters
        ----------
        from_gridfs : bool, optional (default is False)
            Whether to build where clause for gridfs.

        Other Parameters
        ----------------
        package_name : str, optional (default is None)
        apk_hash : str, optional (default is None)
        version_name : str, optional (default is None)
        tag : str, optional (default is None)

        script_hash : str, optional (default is None)
        script_name : str, optional (default is None)
        script_version : str, optional (default is None)

        Notes
        -----
        If any of the other parameters is None it won't be used for filtering.

        Returns
        -------
        '''
        # create filter dict
        wheres = []
        wheres += MongoUtil.build_apk_meta_where(kwargs, gridfs = from_gridfs)
        wheres += MongoUtil.build_script_meta_where(kwargs, gridfs = from_gridfs)
        return dict(wheres)