Details
-
Bug
-
Resolution: Done
-
Minor - P4
-
2.5.4
-
ALL
Description
In the spec it says:
Examples of sorts disallowed by the grammar:
{“x.y”: {$meta: “text”}}Examples invalid queries with a $meta sort (where a corresponding $meta projection is not correctly specified):
db.collection.find({$text: {$search: “hello”}, {t: {$meta: “text”}}).sort({s: {$meta: “text”}})
Yet this appears to work (and sort using the text metadata):
> db.test.find(
|
{ $text: {$search: "tyler" }}, |
{s: {$meta: "text"}}).sort({"WRONG.\^$.$$$": {$meta: "text"}} |
)
|
{ "words" : "tyler brock", "cool" : true, "s" : 0.75 } |
{ "words" : "tyler brock awesome cool", "s" : 0.625 } |
{ "words" : "tyler brock cool cool", "s" : 0.625 } |