Skip to content

Add method to check model existence #486

@kiaking

Description

@kiaking

Add exists method on Model and Query to check if the record exists in the store.

// Check if there's at least 1 record in the store.
User.exists()

// Check if there's at least 1 user with the name of 'John' in the store.
User.query().where('name', 'John').exists()

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestreleasedThe issue was implemented and it is released publicly

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions