The getCollection (' hb_question_standards2). Aggregate ([
{$project: {title: 1, commonToBoth: {$setIntersection: [[" pay ", "car", "mobile", "transport", "time", "train", "motor vehicle", "pay the time", "regulations", "how" and "how to pay"], "$mapDarkTitle. The word"]}}},
{$project: {title: 1, commonToBoth: 1, commonToBothSize: {size: [" $commonToBoth "]}}},
{$sort: {" commonToBothSize ": 1}},
{$limit: 30},
]);
(" pay ", "car", "mobile", "transport", "time", "train", "motor vehicle", "pay the time", "regulations", "how" and "how to pay"] is variable, and perform the above statement, get the following results (is expected results)
Now I want to have words with spring date mongo, check data after the attempt failed,
My students party, understanding is not deep enough, hope have predecessors to spend a few minutes time to give directions, I how the original statement into a corresponding spring date mongo query,
CodePudding user response:
Success has been resolved, through the interface to access the resultingImitation monggo original statement, beta, there has been no standard code, believe to be able to read,
List
The Document limit=new Document ();
The Document project=new Document ();
The Document condition=new Document ();
The Document project2=new Document ();
The Document condition2=new Document ();
The Document sort=new Document ();
Condition. The put (" title ", 1);
List