我正在从数据库中读取数据:我有我想要的值
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"}
]