小编nev*_*are的帖子

带有分片集合的ArangoDB批处理问题

我在一台服务器上建立了一个arangodb 3.1.10集群,该服务器有3个代理,5个协调器和5个初选.我在使用带分片集合的大批量时遇到问题.

我经常在负责批量查询的协调器中收到以下错误:

2017-02-15T15:23:28Z [2665] ERROR {cluster} cannot create connection to server 'PRMR-6f3a5704-5500-4fa8-8933-5029e492c25d' at endpoint 'tcp://localhost:4101'
2017-02-15T15:23:28Z [2665] ERROR {cluster} cannot create connection to server 'PRMR-6f3a5704-5500-4fa8-8933-5029e492c25d' at endpoint 'tcp://localhost:4101'
Run Code Online (Sandbox Code Playgroud)

Localhost:4101是主要的.但它自己的日志不会显示任何错误:

2017-02-15T14:38:10Z [2582] INFO ArangoDB 3.1.10 [linux] 64bit, using VPack 0.1.30, ICU 54.1, V8 5.0.71.39, OpenSSL 1.0.1e-fips 11 Feb 2013
2017-02-15T14:38:10Z [2582] INFO using SSL options: SSL_OP_CIPHER_SERVER_PREFERENCE, SSL_OP_TLS_ROLLBACK_BUG
2017-02-15T14:38:10Z [2582] INFO Starting up with role PRIMARY
2017-02-15T14:38:27Z [2582] INFO {cluster} Fresh start. Persisting new UUID PRMR-6f3a5704-5500-4fa8-8933-5029e492c25d
2017-02-15T14:38:27Z [2582] INFO file-descriptors (nofiles) …
Run Code Online (Sandbox Code Playgroud)

arangodb

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

可以通过索引在 MongoDB 中使 $unwind 快速吗?

在一个集合中,我有一个包含数组的对象,我想在该数组中查找某些对象而不查看整个数组。我收藏中的对象如下所示:

{
    "transactions": [
        {"id": randint(0, 100000), "hello": randint(0, 1000)} for _ in range(100000)
    ]
}
Run Code Online (Sandbox Code Playgroud)

我想获取集合中所有 id 为 17 的交易。所以我创建了这个索引:

db.toto.createIndex({'transactions.id': 1})
Run Code Online (Sandbox Code Playgroud)

但是要只查看我想要的交易,我必须执行 $unwind 并且这个 unwind 仍然很慢:

db.toto.aggregate(
        [
            {"$match": {"transactions.id": 17}},
            {"$unwind": "$transactions"},
            {"$match": {"transactions.id": 17}},
        ]
    )
Run Code Online (Sandbox Code Playgroud)

给我

    [{'_id': ObjectId('5bf854f685699a394ce5ba82'),
  'transactions': {'hello': 920, 'id': 17}},
 {'_id': ObjectId('5bf854f685699a394ce5ba82'),
  'transactions': {'hello': 446, 'id': 17}},
 {'_id': ObjectId('5bf854f685699a394ce5ba84'),
  'transactions': {'hello': 822, 'id': 17}},
 {'_id': ObjectId('5bf854f685699a394ce5ba84'),
  'transactions': {'hello': 830, 'id': 17}},
 [...]
 {'_id': ObjectId('5bf854f885699a394ce5ba89'),
  'transactions': {'hello': 301, 'id': 17}},
 {'_id': ObjectId('5bf854f985699a394ce5ba8b'),
  'transactions': …
Run Code Online (Sandbox Code Playgroud)

mongodb

5
推荐指数
1
解决办法
1364
查看次数

标签 统计

arangodb ×1

mongodb ×1