Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

oneToMany with no matches should get empty array instead of undefined #12

Open
dfahlander opened this issue Mar 16, 2017 · 0 comments
Open

Comments

@dfahlander
Copy link
Owner

Basically, I would like to assert that when expecting an "albums" property, it should always be there. If no items matches, it should be empty instead of not defined at all:

db.bands.add({
        id: 3,
        name: 'Band without albums',
        genreId: 1
})

const results = await db.bands.with({albums: 'albums'});

// Here's the assertion I would like to have:
assert (results.every(band => band.albums && Array.isArray(band.albums)));
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant