Skip to content

Filtering on embedded document fields is not working #1460

@draghuram

Description

@draghuram

Expected Behavior

I defined two resources "people" and "countries" with "people" containing a "data_relation' field of "countries" resource. When I query people as follows, the response doesn't contain any resources even though there should be some satisfying the criteria.

settings = {
    'RESOURCE_METHODS': ['GET', 'POST'],
    'ITEM_METHODS': ['GET', 'PATCH', 'DELETE'],
    'DOMAIN': {
        'people': {
            "schema": {
                "name": {
                    "type": "string"
                },
                "country": {
                    'required': True,
                    'type': 'objectid',
                    'data_relation': {
                        'resource': 'countries',
                        'field': '_id',
                        'embeddable': True
                    },
                }
            }
        },
        'countries': {
            "schema": {
                "name": {
                    "type": "string"
                },
            }
        }
    }
}

$ curl  'http://localhost:5000/people?where=\{"country.name":"US"\}'

Environment

  • Python version: 3.8
  • Eve version: Tested with latest release as well as master.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions