Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-6039

The queryVector property in $vectorSearch aggregation takes doubles only and any int trips it up

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Use Case

      Use $vectorSearch with numbers that happen to be round integer numbers.

       

      JavaScript numbers are all doubles and the driver (understandably) tries to send integers where possible given that when users insert 1, 2, 3, etc they probably meant integers. In most cases the server doesn't care. For $vectorSearch the server seems to be particularly finicky and errors out.

       

      Mongosh, Compass and every user's script or app that uses the node driver to perform $vectorSearch could cast the numbers to Double before passing it to the driver OR the driver could cast them before passing it to the server OR the server could relax their requirement a bit and just deal with integers.

      User Impact

      • No idea, but 0 and 1 are probably pretty common numbers.

       

       

            Assignee:
            Unassigned Unassigned
            Reporter:
            leroux.bodenstein@mongodb.com Le Roux Bodenstein
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: