我在Why $in is much faster than $all?之前问了一个类似的问题,答案是,由于排序或其他原因,$ in(扫描更多行并返回更多结果)应该更快。
我不认为这是问题,所以我只用一个项目测试$ all。
$ all只有一个项目与正常搜索相同吗?
这是没有$ all的日志(我使用了47个测试用例和30个线程):
现在的问题不是$ all比$ in慢。 $ all比任何时候都慢。包括基本搜索。
Thu Sep 20 17:27:05 [conn11] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^emic/ } ntoreturn:20 reslen:20 404ms
Thu Sep 20 17:27:05 [conn21] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^jakarta/ } ntoreturn:20 nreturned:20 reslen:1193 67ms
Thu Sep 20 17:27:05 [conn15] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^sap/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1138 219ms
Thu Sep 20 17:27:05 [conn5] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^ione/ } ntoreturn:20 reslen:20 326ms
Thu Sep 20 17:27:05 [conn20] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^phi/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1210 340ms
Thu Sep 20 17:27:05 [conn13] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^dentist/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1074 252ms
Thu Sep 20 17:27:05 [conn23] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^othe/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1048 113ms
Thu Sep 20 17:27:05 [conn9] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^kota/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1147 296ms
Thu Sep 20 17:27:05 [conn7] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^budi/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1068 250ms
Thu Sep 20 17:27:05 [conn16] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^atc/ } ntoreturn:20 reslen:20 364ms
Thu Sep 20 17:27:06 [conn21] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^mir/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1055 275ms
Thu Sep 20 17:27:06 [conn11] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^mogo/ } ntoreturn:20 nscanned:6 nreturned:6 reslen:347 325ms
Thu Sep 20 17:27:06 [conn5] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^pondok/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:993 184ms
Thu Sep 20 17:27:06 [conn15] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^aneka/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1114 257ms
Thu Sep 20 17:27:06 [conn20] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^tv/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1154 173ms
Thu Sep 20 17:27:06 [conn7] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^t/ } ntoreturn:20 nreturned:20 reslen:1085 3ms
Thu Sep 20 17:27:06 [conn9] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^system/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1271 177ms
Thu Sep 20 17:27:06 [conn13] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^crepes/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1134 302ms
Thu Sep 20 17:27:06 [conn23] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^factor/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1324 340ms
Thu Sep 20 17:27:06 [conn16] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^baso/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1214 239ms
Thu Sep 20 17:27:06 [conn15] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^forward/ } ntoreturn:20 nreturned:20 reslen:1351 52ms
Thu Sep 20 17:27:06 [conn21] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^permai/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1268 318ms
Thu Sep 20 17:27:06 [conn11] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^eam/ } ntoreturn:20 reslen:20 311ms
Thu Sep 20 17:27:06 [conn5] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^elf/ } ntoreturn:20 nscanned:1 nreturned:1 reslen:80 319ms
Thu Sep 20 17:27:06 [conn20] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^anugrah/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1191 279ms
Thu Sep 20 17:27:07 [conn9] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^mac/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1234 282ms
Thu Sep 20 17:27:07 [conn13] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^happy/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1153 298ms
Thu Sep 20 17:27:07 [conn7] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^warding/ } ntoreturn:20 reslen:20 408ms
Thu Sep 20 17:27:07 [conn21] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^g/ } ntoreturn:20 nreturned:20 reslen:1220 3ms
Thu Sep 20 17:27:07 [conn23] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^otak/ } ntoreturn:20 nscanned:3 nreturned:3 reslen:204 336ms
Thu Sep 20 17:27:07 [conn16] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^nail/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1226 312ms
Thu Sep 20 17:27:07 [conn15] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^apotik/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:977 195ms
Thu Sep 20 17:27:07 [conn11] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^kare/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1116 295ms
Thu Sep 20 17:27:07 [conn5] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^king/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1131 252ms
Thu Sep 20 17:27:07 [conn9] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^modern/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1069 252ms
Thu Sep 20 17:27:07 [conn20] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^dutamas/ } ntoreturn:20 nscanned:6 nreturned:6 reslen:396 326ms
Thu Sep 20 17:27:07 [conn21] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^course/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1185 237ms
Thu Sep 20 17:27:07 [conn7] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^elle/ } ntoreturn:20 nscanned:3 nreturned:3 reslen:180 349ms
Thu Sep 20 17:27:07 [conn13] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.000785114234121064
如果使用$ all
,结果如下hu Sep 20 16:51:32 [conn11] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^ykai/ ] } } ntoreturn:20 reslen:20 1712ms
Thu Sep 20 16:51:33 [conn21] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^mnctv/ ] } } ntoreturn:20 reslen:20 1543ms
Thu Sep 20 16:51:33 [conn5] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^edric/ ] } } ntoreturn:20 reslen:20 1378ms
Thu Sep 20 16:51:33 [conn16] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^emobile/ ] } } ntoreturn:20 nscanned:1 nreturned:1 reslen:68 1435ms
Thu Sep 20 16:51:33 [conn15] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^foodfes/ ] } } ntoreturn:20 nscanned:1 nreturned:1 reslen:73 1657ms
Thu Sep 20 16:51:33 [conn20] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^consys/ ] } } ntoreturn:20 reslen:20 1698ms
Thu Sep 20 16:51:33 [conn7] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^nokiaw/ ] } } ntoreturn:20 reslen:20 1747ms
Thu Sep 20 16:51:33 [conn13] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^elf/ ] } } ntoreturn:20 nscanned:1 nreturned:1 reslen:80 1572ms
Thu Sep 20 16:51:33 [conn9] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^rmhku/ ] } } ntoreturn:20 reslen:20 1553ms
Thu Sep 20 16:51:34 [conn11] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^refly/ ] } } ntoreturn:20 reslen:20 1768ms
Thu Sep 20 16:51:34 [conn23] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^yuanita/ ] } } ntoreturn:20 reslen:20 1913ms
Thu Sep 20 16:51:34 [conn5] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^mediate/ ] } } ntoreturn:20 nscanned:2 nreturned:2 reslen:103 1543ms
Thu Sep 20 16:51:34 [conn15] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^diskus/ ] } } ntoreturn:20 nscanned:1 nreturned:1 reslen:70 1411ms
Thu Sep 20 16:51:34 [conn21] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^rico/ ] } } ntoreturn:20 nscanned:8 nreturned:8 reslen:486 1748ms
Thu Sep 20 16:51:34 [conn16] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^bismart/ ] } } ntoreturn:20 reslen:20 1643ms
Thu Sep 20 16:51:35 [conn13] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^livera/ ] } } ntoreturn:20 reslen:20 1502ms
Thu Sep 20 16:51:35 [conn20] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^kikirna/ ] } } ntoreturn:20 reslen:20 1693ms
Thu Sep 20 16:51:35 [conn11] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^factor/ ] } } ntoreturn:20 nscanned:20 nreturned:20 reslen:1324 1161ms
Thu Sep 20 16:51:35 [conn9] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^haytien/ ] } } ntoreturn:20 reslen:20 1679ms
Thu Sep 20 16:51:35 [conn7] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^harni/ ] } } ntoreturn:20 nscanned:1 nreturned:1 reslen:86 1994ms
Thu Sep 20 16:51:36 [conn23] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^otak/ ] } } ntoreturn:20 nscanned:3 nreturned:3 reslen:204 1912ms
Thu Sep 20 16:51:36 [conn5] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^bluenet/ ] } } ntoreturn:20 reslen:20 1598ms
Thu Sep 20 16:51:36 [conn21] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^topwan/ ] } } ntoreturn:20 reslen:20 1549ms
Thu Sep 20 16:51:36 [conn15] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^tobas/ ] } } ntoreturn:20 nscanned:1 nreturned:1 reslen:54 1596ms
Thu Sep 20 16:51:36 [conn16] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^imagen/ ] } } ntoreturn:20 nscanned:1 nreturned:1 reslen:55 1595ms
Thu Sep 20 16:51:36 [conn9] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^corocot/ ] } } ntoreturn:20 nscanned:2 nreturned:2 reslen:128 1280ms
Thu Sep 20 16:51:36 [conn13] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^pdor/ ] } } ntoreturn:20 reslen:20 1682ms
Thu Sep 20 16:51:36 [conn20] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^elcom/ ] } } ntoreturn:20 nscanned:1 nreturned:1 reslen:63 1865ms
Thu Sep 20 16:51:37 [conn11] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^delapan/ ] } } ntoreturn:20 nscanned:6 nreturned:6 reslen:358 1740ms
Thu Sep 20 16:51:37 [conn7] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^tato/ ] } } ntoreturn:20 nscanned:13 nreturned:13 reslen:863 1678ms
Thu Sep 20 16:51:37 [conn23] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^mac/ ] } } ntoreturn:20 nscanned:20 nreturned:20 reslen:1234 1197ms
Thu Sep 20 16:51:37 [conn5] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^dutamas/ ] } } ntoreturn:20 nscanned:6 nreturned:6 reslen:396 1455ms
Thu Sep 20 16:51:37 [conn16] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^jeneiro/ ] } } ntoreturn:20 reslen:20 1466ms
注意:我知道只使用一个单词的$ all是没用的,这就是重点。
我用一个词来表明问题不在于索引,或者是自己的查询。
在未来显然我将使用$ all来获得2-3个关键字。但是,在这个示例中,我只使用了一个单词,因此很明显问题不在于结果不同而是更为基础的事实。
$ in完全不成问题。这里似乎有问题:https://jira.mongodb.org/browse/SERVER-1745但我不明白。什么是server-1745?
答案 0 :(得分:1)
此功能的设计与Why $in is much faster than $all?中已回答的设计一致。
$ all只有一个项目与正常搜索相同吗?
不,它是一个不同的代码路径和不同的运算符。
MongoDB解释了差异here。 $ all匹配所有值而不是任何值($ in in)。进一步使用examepls here。
您需要的相关SERVER票证是here。你可以对这张票进行投票。