データベースからデータを読み取っています: 必要な値があります
for (var index in entities) {
console.log(entities[index].PartitionKey);
console.log(entities[index].RowKey);
console.log(entities[index].Details);
console.log(entities[index].Date);
}
上記は、必要なすべてのデータを出力します。これをJsonオブジェクトとして変換したいと思います。どうやってやるの 。
私はJSON.stringifyを使用できることを使用して認識していますが、このコンテキストでこれを試していると、エラーが発生します。
私はforloopにとどまろうとしました:
jasonarray[index1].PartitionKey = entities[index].PartitionKey;
jasonarray[index1].RowKey = entities[index].RowKey;
と
JSON.stringify({ key: jasonarray[index1].PartitionKey, RowKey: jasonarray[index1].RowKey )
しかし、この関数の実行に関しては未定義として与えています。
私が探しているのは var x だけです:
where x is a
[
{partionkey: "val",key: "val"}
{partionkey: "val",key1: "val"}
{partionkey: "val",key2: "val"}
]