[DRIVERS-545] Support index all paths Created: 24/Jul/18  Updated: 28/Oct/23  Resolved: 16/Dec/20

Status: Closed
Project: Drivers
Component/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Rathi Gnanasekaran Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: newdriver
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on CDRIVER-2842 Support index all paths Closed
depends on CSHARP-2408 Support index all paths Closed
depends on CXX-1661 Support index all paths Closed
depends on JAVA-3014 Support index all paths Closed
depends on MOTOR-272 Support index all paths Closed
depends on NODE-1696 Support index all paths Closed
depends on RUBY-1484 Support index all paths Closed
depends on RUST-112 Support index all paths Closed
depends on GODRIVER-906 Support wildcardProjection index option Closed
depends on PYTHON-1789 Support index all paths: update docum... Closed
Duplicate
Related
Server Compat: 4.1
Start date:
Driver Compliance:
Key Status/Resolution FixVersion
NODE-1696 Won't Fix
SCALA-452 Done
CSHARP-2408 Fixed 2.9.0
PERL-1008 Fixed 2.1.0
RUBY-1484 Works as Designed
JAVA-3014 Fixed 3.11.0
CXX-1661 Works as Designed
MOTOR-272 Works as Designed
CDRIVER-2842 Works as Designed 1.15.0
RUST-112 Done
PYTHON-1789 Fixed 3.9
GODRIVER-906 Fixed 1.1.0
SWIFT-481 Fixed 1.1.0

 Description   

All drivers must support the new "wildcard" index type which will be added in MongoDB 4.2. Wildcard indexes are defined like this:

{ 
   key: {
       "$**": 1
   }
}

A single subtree can be indexed like so:

{ 
    key: {
         "<field>.$**": 1
    }
}

Projections are also possible using a new wildcardProjection index model option:

{
  key: {
      "$**": 1
  },
  name: "foo",
  “wildcardProjection”: {
        "name": 1,
        "category": 1, 
        "cost": 1, 
        "descriptors": 1
   }
}

See the server syntax document for details.



 Comments   
Comment by Bernie Hackett [ 05/Jun/19 ]

Docs: https://docs.mongodb.com/master/core/index-wildcard/

Comment by Shane Harvey [ 27/Sep/18 ]

Python does not validate index fields either so we can send "$**" with our helpers just fine.

Comment by David Golden [ 27/Sep/18 ]

Perl does not validate index fields.

Comment by Jeremy Mikola [ 26/Sep/18 ]

PHPC has no index helpers. PHPLIB does not validate field names in the keys document for its createIndex() and createIndexes() helpers.

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