Skip to content
New issue

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

Support queries with a "not" filter condition #44

Open
darrenklein opened this issue Mar 26, 2020 · 0 comments
Open

Support queries with a "not" filter condition #44

darrenklein opened this issue Mar 26, 2020 · 0 comments
Labels
to-do Features/tasks that we'd like to add to the adapter.

Comments

@darrenklein
Copy link
Contributor

A query with a not filter condition will fail to account for that condition. For example:

from(f in Foo, where: f.bar == "1234" and not is_nil(f.deleted_at))
|> Locus.Repo.all()

will return all records where f.bar == "1234", regardless of their deleted_at status - expected behavior would to be to return all records where f.deleted is not nil.

DynamoDB does support this kind of query:

var params = {
    TableName: 'foo',
    IndexName: 'bar',
    KeyConditionExpression: 'bar = :value',
    FilterExpression: 'attribute_exists(deleted_at) and deleted_at <> :null',
    ExpressionAttributeValues: {
      ':value': '1234',
      ':null': null
    },
};
docClient.query(params, function(err, data) {
    if (err) ppJson(err);
    else ppJson(data);
});
@darrenklein darrenklein added the to-do Features/tasks that we'd like to add to the adapter. label Mar 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to-do Features/tasks that we'd like to add to the adapter.
Projects
None yet
Development

No branches or pull requests

1 participant