from mdf_forge.forge import Forge

mdf = Forge()

"""
Explanation: Part 3 - Expanded Query Builder Functions
End of explanation
"""


mdf.match_exists("services.globus_publish")

mdf.search(limit=10)

"""
Explanation: More Query Builders
match_exists
match_exists() matches entries where there is any value in the field. As long as the field exists in the entry, it's a match.
End of explanation
"""


mdf.match_not_exists("services.mrr")

mdf.search(limit=10)

"""
Explanation: match_not_exists
match_not_exists() is the opposite of match_exists(). Any entry without the given field is a match.
End of explanation
"""


mdf.match_range("mdf.scroll_id", 0, 10)

"""
Explanation: match_range
match_range() is the same as match_field() except that the value is a range. Strings are allowed as ranges at your own risk (they're evaluated based on alphabetical order, but can sometimes have unexpected results).
End of explanation
"""


mdf.exclude_range("mdf.scroll_id", 100, 199)

mdf.search(limit=10)

"""
Explanation: exclude_range
Similarly, you can exclude a range with exclude_range().
End of explanation
"""


mdf.exclusive_match("material.elements", "O").search(limit=10)

"""
Explanation: exclusive_match
If you want a key to have exactly a certain value, use exclusive_match(). This is most useful in the case of lists.
End of explanation
"""


