Skip to content

Conversation

@johnnyshields
Copy link
Contributor

@johnnyshields johnnyshields commented Oct 19, 2023

Goal

In Mongo queries, it is very common to set a filter with "$in": [ some long array ] to avoid N+1 queries. Here's how this looks in the breadcrumb:
image

This is a problem because:

  1. Its a ton of text
  2. It's difficult to know how many members the array actually has.

Design

To fix this, in the Mongo filter field, an Array which (a) has more than 3 members and (b) does not contain nested Arrays or Hashes will be summarized as ["LENGTH=42"] (e.g. if it has 42 members)

Changeset

Only changes the Mongo breadcrumb functionality.

This also includes the changes from:

Testing

Tested in RSpec and by TableCheck in production.

@johnnyshields johnnyshields changed the title Mongo filter array length Mongo breadcrumb: Summarize the length of long arrays Oct 19, 2023
@clr182
Copy link

clr182 commented Oct 19, 2023

Hi @johnnyshields
Thanks for raising this PR. We will be sure to take a look when priority allows us.

@clr182 clr182 added feature request Request for a new feature backlog We hope to fix this feature/bug in the future labels Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backlog We hope to fix this feature/bug in the future feature request Request for a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants