We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When running lt conditions, electrodb builds the sk but doesn't care about adding a FilterExpression (which seems to me like the correct behavior).
lt
lt: { name: "lt", action(entity, state, facets = {}) { if (state.getError() !== null) { return state; } try { return state.setType(QueryTypes.lt).ifSK((state) => { const { pk, sk } = state.getCompositeAttributes(); const { composites } = state.identifyCompositeAttributes( facets, sk, pk, ); state.setSK(composites); }); } catch (err) { state.setError(err); return state; } }, children: ["go", "params"], },
When running lte conditions, it adds a FilterExpression on top of the ConditionExpression:
lte
lte: { name: "lte", action(entity, state, facets = {}) { if (state.getError() !== null) { return state; } try { return state.setType(QueryTypes.lte).ifSK((state) => { const { pk, sk } = state.getCompositeAttributes(); const { composites } = state.identifyCompositeAttributes( facets, sk, pk, ); state.setSK(composites); const accessPattern = entity.model.translations.indexes.fromIndexToAccessPattern[ state.query.index ]; if (!entity.model.indexes[accessPattern].sk.isFieldRef) { state.filterProperties(FilterOperationNames.lte, composites); // <---- HERE } }); } catch (err) { state.setError(err); return state; } }, children: ["go", "params"], },
The same happens with greater than conditions (differently though, it's gt that gets the FilterExpression while gte doesn't).
gt
gte
Is this intentional? If so what's the rationale behind this decision? Why not allow users to decide their FilterExpression using the where command?
where
As it stands, there's no way to build a lt or gte query with a composite SK without a FilterExpression (as far as I'm aware).
The text was updated successfully, but these errors were encountered:
Good question! Feel free to weigh in here: #228
Sorry, something went wrong.
Hi @andrestone 👋
I just published version 3.0.0 which removes the character shifting and extra filters by default. Let me know if you have any questions!
3.0.0
No branches or pull requests
When running
lt
conditions, electrodb builds the sk but doesn't care about adding a FilterExpression (which seems to me like the correct behavior).When running
lte
conditions, it adds a FilterExpression on top of the ConditionExpression:The same happens with greater than conditions (differently though, it's
gt
that gets the FilterExpression whilegte
doesn't).Is this intentional? If so what's the rationale behind this decision? Why not allow users to decide their FilterExpression using the
where
command?As it stands, there's no way to build a
lt
orgte
query with a composite SK without a FilterExpression (as far as I'm aware).The text was updated successfully, but these errors were encountered: