Question: Comparing Distinct Arrays of Objects
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 20/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript
- 領域
- backend
調査の方向性
ファイルまたはテストのエントリポイントは指定されていません。まず、配列パスの評価に関係するルール条件と演算子レジストリを確認してください。提供された2つのfactsの例を使い、同一オブジェクトのマッチングが1つ目ではfalseを返し、2つ目ではtrueを返すことを完了条件として定義してください。
索引モデルが issue の本文から書いたものです。
説明
Hello,
I am trying to compare an array of objects to check for a specific set of objects to be present in any of them, but not across all of them, specifically lets take this rule:
const arrayRule = {
conditions: {
any: [
{
all: [
{
fact: 'data',
path: '$.[*].equalityTest',
operator: 'equal',
value: 50,
},
{
fact: 'data',
path: '$.[*].anotherTest',
operator: 'equal',
value: 50,
},
],
},
],
},
event: {
type: 'arrayRule',
},
};
This is the first iteration of the rule I came up with, it is incorrect, but I wanted to give an idea of what I am aiming for.
Specifically here, we have a rule where I want equalityTest to equal 50 and anotherTest to also equal 50. But I want them to equal those values in the same object, such that:
THIS SHOULD RETURN FALSE
const facts = {
data: [
{
anotherIntegerFact: 1,
equalityTest: 50,
},
{
anotherIntegerFact: 50,
equalityTest: 40,
},
],
};
THIS SHOULD RETURN TRUE
const facts = {
data: [
{
anotherIntegerFact: 50,
equalityTest: 50,
},
{
anotherIntegerFact: 40,
equalityTest: 40,
},
],
};
Would love any suggestions or ideas on a way to tackle this. One thought was I could write my own operator and add it to the registry of operators on our end, but before I did so, I wanted to validate that is needed.
Thanks
- 主要言語
- JavaScript
- スター
- 3.1k
- フォーク
- 507
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CacheControl/json-rules-engine のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
CacheControl/json-rules-engine#427 · リアクション 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
CacheControl/json-rules-engine#424 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
CacheControl/json-rules-engine#421 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
CacheControl/json-rules-engine#417 · リアクション 1 件 ·
CacheControl/json-rules-engine の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
palladius/rails8-app-on-gcp#145 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
dotenvx/dotenv-vscode#139 ·
-
test-change-proposal
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
web-platform-tests/interop#1455 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
corsairdev/corsair#1764 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100