def _generate_join(collection, local_id, foreign_id):
    """Make join string for query from parameters."""
    text = '{{!join from={fid} to={lid} fromIndex={collection}}}'
    text = text.format(collection=collection, lid=local_id, fid=foreign_id)
    return text
