Skip to content

BUG: Unable to query non-primary ObjectId fields in MongoDB #12

@itsamrit

Description

@itsamrit

Describe the bug:
When using Beekeeper Studio with MongoDB (via QueryLeaf), I am unable to search on fields of type ObjectId if they are not the primary key (_id). It seems Beekeeper only supports querying _id as an ObjectId.

For example, the following query does not return any results, even though matching documents exist:

select * from soldinventories where transaction_id = '68c7199af2aae351fa1f2287';

If I query by _id, it works as expected. eg:
select * from soldinventories where _id = '68c719aff2aae351fa1f22d7';

Steps to reproduce

Connect to a MongoDB database in Beekeeper Studio.

Open a collection that has a field of type ObjectId other than _id (e.g., transaction_id).

Try running a query such as:
select * from soldinventories where transaction_id = '68c7199af2aae351fa1f2287';

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