Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-22954

Use native double instead of NumberLong for MongoDB index direction

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 8.10
    • Fix Version/s: 8.10-HF13, 9.3
    • Component/s: Core MongoDB
    • Release Notes Summary:
      Use native double instead of NumberLong for MongoDB index direction
    • Sprint:
      nxFG 9.3.3
    • Story Points:
      1

      Description

      Currently an index is created like

      {
      		"v" : 2,
      		"key" : {
      			"ecm:id" : NumberLong(1)
      		},
      		"name" : "ecm:id_1",
      		"ns" : "nuxeosb.default"
      	}
      

      whereas it should be

      			"ecm:id" : 1
      

      This is due to a conversion issue between Java numbers and JS numbers, where floats are the default numeric type.

      Note that the issue here is not with MongoDB, which works fine with these index definitions, but with associated tools like MongoDB Operations Manager and its automation component, which fail to parse these indexes correctly even though they are documented as legal in the MongoDB documentation (https://docs.mongodb.com/manual/core/index-single/ says Some drivers may specify indexes using NumberLong(1) rather than 1 as the specification. This does not have any affect on the resulting index.)

      In addition, the 8.10 codebase has a typo in one place and uses -11 instead of -1. This must be corrected (already fixed in master during other refactorings).

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h