小编jon*_*eck的帖子

MongoDB 排序使用的内存超过了最大 RAM,但是否使用了索引?

我正在调试一个带有分页结果的站点搜索功能,该功能在任意数量的页面后失败。

search: Executor error during find command: OperationFailed: Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit.
Run Code Online (Sandbox Code Playgroud)

但是,我确信它正在使用索引:

   winningPlan:
    { stage: 'PROJECTION',
      transformBy:
       { score: { '$meta': 'textScore' },
         shootId: 1,
         title: 1,
         publishDate: 1,
         'media.images.indexImage': 1,
         'media.images.adImage': 1,
         'media.images.galleryImages': 1,
         'media.images.portrait': 1,
         'media.promos.images.410': 1,
         'media.full.full.length': 1,
         contentProducer: 1,
         performers: 1,
         site: 1 },
      inputStage:
       { stage: 'TEXT',
         indexPrefix: {},
         indexName: 'textSearchIndex',
         parsedTextQuery:
          { terms: [ 'milk' ],
            negatedTerms: [], …
Run Code Online (Sandbox Code Playgroud)

mongoose mongodb node.js

5
推荐指数
0
解决办法
958
查看次数

标签 统计

mongodb ×1

mongoose ×1

node.js ×1