小编Far*_*ter的帖子

dyld:惰性符号绑定失败:未找到符号:_node_module_register

我已经尝试重新安装和重建npm,但问题仍然存在.

最初,问题在于模块mongodb:我没有那个包,所以我mongodb使用这个命令安装npm install mongodb.

它向我显示以下错误:
dyld: Symbol not found: _node_module_register

node.js npm

12
推荐指数
2
解决办法
1万
查看次数

如何正确创建索引mongodb?

让我说我有这么大的文件.

其中2个得到了这个对象数组;

{
  status: "A",
  group: "public",
  "created.dt": ....
}

{
  status: "A",
  group: "private",
  "created.dt": ....
}
Run Code Online (Sandbox Code Playgroud)

我索引并确保这样:

db.collection.ensureIndex({"created.dt":-1});

db.collection.ensureIndex({"created.dt":-1, "status":1});
db.collection.ensureIndex({"created.dt":-1, "group":1});

db.collection.ensureIndex({"created.dt":-1, "status":1, "group":1});
Run Code Online (Sandbox Code Playgroud)

查询:

db.collection.find(
{
  "status": { 
    $in: ["A", "I"] 
  },
  "asset_group": "public"
},
{
  sort: {
   'created.dt':1
  }
}
).count();
Run Code Online (Sandbox Code Playgroud)

这是错的吗 ?

在我使这个指数仍然缓慢之后.请帮我正确索引.谢谢

mongodb mongodb-query mongodb-indexes

3
推荐指数
1
解决办法
2928
查看次数

标签 统计

mongodb ×1

mongodb-indexes ×1

mongodb-query ×1

node.js ×1

npm ×1