-
Type: Bug
-
Resolution: Duplicate
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
-
None
-
Environment:OS:
node.js / npm versions:
Additional info:
-
Not Needed
-
Developer Tools
Steps to Reproduce
In mongosh run the following commands:
- db.collection.createIndex({a: 1}, {v: 1})
- db.collection.getIndexes()
Expected Results
[ { v: 2, key: { _id: 1 }, name: '_id_' }, { v: 1, key: { a: 1 }, name: 'a_1' } ]
Actual Results
[ { v: 2, key: { _id: 1 }, name: '_id_' }, { v: 2, key: { a: 1 }, name: 'a_1' } ]
Additional Notes
The mongo shell built from "ninja install-devcore" still behaves as expected.
(python3-venv) ubuntu@ip-10-122-6-82:~/mongo$ ./build/install/bin/mongo MongoDB shell version v8.0.0-alpha-779-g2085354 connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb Implicit session: session { "id" : UUID("e94fcd56-dd45-42d8-be36-5e10d0a3c9aa") } MongoDB server version: 8.0.0-alpha-779-g2085354 ================ Warning: the "mongo" shell has been superseded by "mongosh", which delivers improved usability and compatibility.The "mongo" shell has been deprecated and will be removed in an upcoming release. > db.collection.createIndex({a: 1}, {v: 1}) { "numIndexesBefore" : 1, "numIndexesAfter" : 2, "createdCollectionAutomatically" : false, "ok" : 1 } > db.collection.getIndexes() [ { "v" : 2, "key" : { "_id" : 1 }, "name" : "_id_" }, { "v" : 1, "key" : { "a" : 1 }, "name" : "a_1" } ]
- duplicates
-
NODE-5971 use the value of `CreateIndexOptions.version` to specify the index version in `createIndex` helpers
- Closed