Skip to content

Clarification on querying with parameters #92

Answered by appy-one
trenta3 asked this question in Q&A
Discussion options

You must be logged in to vote

I published acebase v1.18.0, try updating and using this code:

// Create index on scattered data:
await db.indexes.create('messages/$username', '{key}'); // {key} indexes the keys of every child of messages/$username

// Query it
let msgcount = await db.query('messages/$username').count();

As you can see, there's no need to add a filter to the count query anymore, it's done automatically behind the scenes. Let me know if it works!

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@trenta3
Comment options

Comment options

You must be logged in to vote
1 reply
@appy-one
Comment options

Comment options

You must be logged in to vote
1 reply
@trenta3
Comment options

Answer selected by trenta3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants