jamesmoss/flywheel

Query not returning result when using first()

Closed this issue · 2 comments

Version: flywheel==0.4.4

I have encountered with an empty result issue when using "first" function on flywheel query object, but got result when using the "all" function (with the same query)

DB schema:


class User(Modal):
__metadata__ = {
        '_name': 'test_table',
        'global_indexes': [
            GlobalIndex('name-age-index', 'name', 'age_min').throughput(5, 3),
        ]
    }
name = Field(hash_key=True)
age_min = Field(data_type=int)      # OPTIONAL
age_max = Field(data_type=int)       # OPTIONAL

Query:

Return None: engine.query(User).filter(User.name == 'Erik', User.age_min <= age, User.age_max >= 18).first()

Return value: engine.query(User).filter(User.name == 'Erik', User.age_min <= age, User.age_max >= 18).all()

I think you've posted on the wrong repo. This is a PHP project.

Sorry, didn't noticed that