Skip to content

Support queries with a "not" filter condition #44

@darrenklein

Description

@darrenklein

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);
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    to-doFeatures/tasks that we'd like to add to the adapter.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions