-
Type: Task
-
Resolution: Gone away
-
Priority: Major - P3
-
Affects Version/s: None
-
Labels:
Description
In 4.2, a find() command with a textScore $meta projection, e.g.
db.c.find({}, {a: {$meta: "textScore"}})
would assign a value of 0 to 'a' if no textScore metadata was available.
The default value in 4.3/master is missing (that is, 'a' will not be present in the returned document).
Feel free to slack me if you have questions.
Description of Linked Ticket
A Java driver functional test of {$meta: "textScore"} projection recently regressed when running against latest mongod. The regression occurred somewhere between the commit hashes 560b542 and c119ef4.
Test setup:
> db.test.insert({x: 1, y: [{a: 1, b: 2}, {a: 2, b: 3}, {a: 3, b: 4}]}) > db.test.createIndex({y: "text"})
Expected results contain a synthetic score field:
> db.test.find({}, {score: {"$meta": "textScore"}}) { "_id" : ObjectId("5da7cc88458e2388ffaedd5f"), "x" : 1, "y" : [ { "a" : 1, "b" : 2 }, { "a" : 2, "b" : 3 }, { "a" : 3, "b" : 4 } ], "score" : 0 }
Results after the regression omit the score field:
MongoDB Enterprise > db.test.find({}, {score: {"$meta": "textScore"}}) { "_id" : ObjectId("5da7ce30522390ed46b8b869"), "x" : 1, "y" : [ { "a" : 1, "b" : 2 }, { "a" : 2, "b" : 3 }, { "a" : 3, "b" : 4 } ] }
Educated guess is that the fix for SERVER-42423 is the culprit.
Scope of changes
Impact to Other Docs
MVP (Work and Date)
Resources (Scope or Design Docs, Invision, etc.)
- documents
-
SERVER-44056 regression in {$meta: "textScore"} projection
- Closed