1

我正在尝试获取那些具有“someArray”的对象 - 数组和 someArray 对象之一“val”> 0 和“someKey”=== 415

如 rxdb 文档中所述,我在 rxDB 中使用 mongoDBs 的链式方法,但是查询数组元素总是返回空数组,它不会给我任何错误。我正在使用 rxdb 版本 8.0.4。

 let localDB = await Database.get();
 let test = await localDB.testTable.find({ someArray: { $elemMatch: { 
    someKey: 415,  value: { $gt: 17 } } } 
    });
    const results = await test .exec().then(result=> {
        console.log("result  : ", result);
    });

预期的结果总是空数组,但在我的 localDB 中存在这些数据,100% 肯定。

4

1 回答 1

1

对于有类似问题的人,必须从模式中删除 keyCompression: true 并添加 pouchDB find 插件并使用 rxdb find not myCollection.pouch.find。:)

于 2019-02-06T16:24:47.747 回答