[JAVA-2628] 2dsphereIndexVersion only allows versions 1 and 2 despite the default being 3 since mongodb v.3.2 Created: 10/Oct/17  Updated: 29/Oct/23  Resolved: 10/Nov/17

Status: Closed
Project: Java Driver
Component/s: Query Operations
Affects Version/s: None
Fix Version/s: 3.6.0

Type: Improvement Priority: Minor - P4
Reporter: Isabel Peters Assignee: Jeffrey Yemin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

2dSphereIndexVersion is 3 by default since mongodb v.3.2. The Java driver throws an IllegalArgumentException if the version is not 1 or 2, thus currently not supporting this type of index for mongodb versions 3.2+.

https://github.com/mongodb/mongo-java-driver/blob/master/driver-core/src/main/com/mongodb/bulk/IndexRequest.java#L326



 Comments   
Comment by Githook User [ 10/Nov/17 ]

Author:

{'name': 'Jeff Yemin', 'username': 'jyemin', 'email': 'jeff.yemin@10gen.com'}

Message: JAVA-2628: Add "3" to the list of valid 2dsphere index versions.
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/71259aec01a4da68bd9d63a08b66c54063b7613e

Comment by Ross Lawley [ 10/Oct/17 ]

The current workaround is to not set a sphereVersion explicitly and that will use the servers default.

Generated at Thu Feb 08 08:57:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.