Skip to content

DOCSP-45398-detail-large-number-queries #742

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

shuangela
Copy link
Contributor

@shuangela shuangela commented Apr 9, 2025

DESCRIPTION

Add information on how to query for large numbers in compass

STAGING

https://deploy-preview-742--docs-compass.netlify.app/query/filter/

JIRA

https://jira.mongodb.org/browse/DOCSP-45398

BUILD LOG

https://app.netlify.com/sites/docs-compass/deploys/67f6e76bf4da2d0008cd45e3

Self-Review Checklist

  • Is this free of any warnings or errors in the RST?
  • Is this free of spelling errors?
  • Is this free of grammatical errors?
  • Is this free of staging / rendering issues?
  • Are all the links working?

External Review Requirements

What's expected of an external reviewer?

Copy link

netlify bot commented Apr 9, 2025

Deploy Preview for docs-compass ready!

Name Link
🔨 Latest commit e817b0d
🔍 Latest deploy log https://app.netlify.com/sites/docs-compass/deploys/67f82e7b2a2e7800085043b7
😎 Deploy Preview https://deploy-preview-742--docs-compass.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator

@jason-price-mongodb jason-price-mongodb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shuangela lgtm with suggestions. Cheers.

wrap the integer in string characters.

For example, to find all documents with a ``number`` value of ``507550989629521900``, use
the following query filter:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"this query filter:"

Comment on lines 3 to 11
To query for integers larger than the JavaScript maximum integer size,
wrap the integer in string characters.

For example, to find all documents with a ``number`` value of ``507550989629521900``, use
this query filter:

.. code-block:: javascript

{ "number": "507550989629521900" }
Copy link

@betsybutton betsybutton Apr 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example doesn't actually work. It's important to mention the need for NumberLong in the example. This is how Compass knows the type to search for. In the example given in the current draft, Compass would interpret the search value as a string, not as a Long (aka large integer).

For example, { restaurant_id: NumberLong(507550989629521900) } would not work, but { restaurant_id: NumberLong("507550989629521900") } would work

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks for the clarification! I'll change the example

@shuangela shuangela requested a review from betsybutton April 10, 2025 20:55
@sarah-olson-mongodb sarah-olson-mongodb merged commit 5dce065 into mongodb:master Apr 11, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants