Skip to content

Convert generates not working SQL from $elemMatch #25

@vyacheslav-sozap

Description

@vyacheslav-sozap

As I can see from test:
https://github.com/thomas4019/mongo-query-to-postgres-jsonb/blob/master/test/filter.js#L33
that query like

{"roles": {"$elemMatch": "Admin"}}

should give SQL like

'data @> \'{ "roles": "Admin" }\''

but if we want to match against any array element, that SQL doesn't do that, it's just checking if "roles" contains string "Admin", so, probably, it should be done somehow else.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions