Skip to content

Support filtering on nested JSON fields (object sub-properties and array elements) in MongoDB collections #2315

Closed

Description

@tyrival

Problem

When TablePro is connected to a MongoDB collection, some fields may be JSON objects (e.g. {"name": "John", "age": 30}) or arrays of JSON objects (e.g. [{"id": 1, "status": "active"}, ...]).

Currently these fields can only be viewed as a whole raw JSON value, and there is no way to query their inner structure. It would be very useful to support:

Querying sub-properties of a JSON object field — e.g. filter records by customer.country == "US".
Filtering on sub-properties of objects inside a JSON array — e.g. find records where any element in items matches a condition like status == "active".
Example:

Consider a MongoDB collection orders with documents like:

{
  "_id": "66f0abc123",
  "order_no": "ORD-001",
  "customer": {
    "name": "Alice",
    "age": 28,
    "country": "US"
  },
  "items": [
    { "sku": "A100", "name": "Laptop", "price": 999.99 },
    { "sku": "B200", "name": "Mouse",  "price": 29.99 }
  ]
}

Desired use cases:

  1. Query a sub-property of the JSON object customer:

Find all orders where customer.country == "US":

db.orders.find({ "customer.country": "US" })
Find all orders where customer.age >= 18:

db.orders.find({ "customer.age": { "$gte": 18 } })
2. Filter on sub-properties of objects inside the JSON array items:

Find all orders containing an item with sku == "A100":

db.orders.find({ "items.sku": "A100" })
Find all orders containing an item with price > 500 and name == "Laptop" (same array element):

db.orders.find({
  "items": { "$elemMatch": { "price": { "$gt": 500 }, "name": "Laptop" } }
})

Proposed behavior:

In the filter/query builder, allow drilling down into JSON object fields using dot notation (e.g. customer.country).
For array fields, support both "match any element" (dot notation) and "match one element satisfying multiple conditions" ($elemMatch).
Optionally, render nested object fields as expandable columns in the table view.
Additional notes:

Nested paths with dot notation should be handled gracefully (field names containing dots are a known edge case in MongoDB).
Please consider how nested fields should appear in the column list / filter dropdown UI.

Proposed solution

No response

Alternatives considered

No response

Related database type

None

Activity

  1. added
    enhancement
    on Aug 21, 2026
  2. self-assigned this
    on Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions