-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: 4.2.1
-
Component/s: Index Maintenance
-
Query Optimization
-
ALL
wildcardProjection does not work for wildcard indexes on a subtree. For example:
Unable to find source-code formatter for language: mongodb. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
db.getCollection("companies").createIndex( { "representatives.$**" : 1 }, {wildcardProjection: {"representatives.niceNames": 0}} );
Gives the error:
{ "ok" : 0.0, "errmsg" : "The field 'wildcardProjection' is only allowed when 'key' is {\"$**\": ±1}", "code" : 9, "codeName" : "FailedToParse" }
Since the doc does not mention any such restriction, I am assuming it's a bug.
- is related to
-
SERVER-391 Support both include and exclude on field filters
- Backlog
-
SERVER-48897 Allow sub-field matching in Wildcard indexes
- Backlog