-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 8.10
-
Component/s: Core MongoDB
-
Release Notes Summary:Use native double instead of NumberLong for MongoDB index direction
-
Tags:
-
Sprint:nxFG 9.3.3
-
Story Points:1
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).