0

我之前问过一个类似的问题,为什么 $in 比 $all 快得多?答案是 $in (扫描更多行并返回更多结果)由于排序或其他原因应该更快的想法。

我认为这不是问题,所以我只用一项测试 $all 。

$all 只有一项与普通搜索等效吗?

这是没有 $all 的日志(我使用了 30 个线程的 4700 个测试用例):

现在的问题不是 $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?

4

1 回答 1

1

这是按照为什么 $in 比 $all 快得多?如回答。

$all 只有一项与普通搜索等效吗?

不,它是不同的代码路径和不同的运算符。

MongoDB 在这里解释了不同之处。$all 匹配所有值,而不是 any($in 匹配)。这里有更多的使用示例。

您想要的相关 SERVER 票在这里。你可以在这张票上投票。

于 2012-09-21T12:14:01.110 回答