[SERVER-12129] $meta projection operator should overwrite fields Created: 16/Dec/13  Updated: 11/Jul/16  Resolved: 07/Feb/14

Status: Closed
Project: Core Server
Component/s: Querying, Text Search
Affects Version/s: None
Fix Version/s: 2.6.0-rc0

Type: Bug Priority: Major - P3
Reporter: Kay Kim (Inactive) Assignee: Benety Goh
Resolution: Done Votes: 0
Labels: 26qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File server12129.js    
Issue Links:
Duplicate
duplicates SERVER-12238 Projecting {$meta: "textScore"} over ... Closed
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

The functional spec states:
If the operator encounters a document where the named field already exists, the operator will replace that field's value

However, the opposite occurs:

>  db.articles.find()
{ "_id" : 1, "subject" : "cake", "score" : 10 }
{ "_id" : 2, "subject" : "cakes and ale", "score" : 5 }
{ "_id" : 3, "subject" : "cakes and more cake", "score" : 6 }
 
 
> db.articles.find(       {  $text: { $search: "coffee cake" } },       { score: { $meta: "text" } }     )
 
{ "_id" : 3, "subject" : "cakes and more cake", "score" : 6, "score" : 6 }
{ "_id" : 2, "subject" : "cakes and ale", "score" : 5, "score" : 5 }
{ "_id" : 1, "subject" : "cake", "score" : 10, "score" : 10 }
 



 Comments   
Comment by Githook User [ 07/Feb/14 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-12129 meta projection operator should overwrite fields
Branch: master
https://github.com/mongodb/mongo/commit/e01492875083bf30bba35b38a8a0301e66c422df

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