此功能是否将结果重复为错误还是我造成的?输出总是有 1 个或多个重复的记录。在这个例子中,中国银行总是在输出中列出两次。
gun.get('savings_accounts').map(function (name, ID) {
console.log( name.name, ID );
}, true)
我的代码:
localStorage.clear();
var gun = Gun();
////////////////////////////////////////////////////// create record
var acc1 = gun.put({
name: "Bank of America",
accType: "Savings",
last4: "4123",
favorite: true,
status: true,
created: "some date created"
});
var acc2 = gun.put({
name: "Bank of China",
accType: "Savings",
last4: "5123",
favorite: true,
status: true,
created: "some date created"
});
gun.get('savings_accounts').map(function (name, ID) {
console.log( name.name, ID );
}, true)