dayPath = ref.path.toString() + '/' + configId + '/screens/' + screenIndex + '/days/',
// the ref for the days object
daysRef = fbutil.ref(dayPath),
// the sync for the days object
daysSync = fbutil.syncObjectReference(daysRef);
// the collection as a $firebase array
var list = daysSync.$asArray(),
items = [],
number;
console.log(list);
list.$add({dummy: 'Test'});
根据文档,当我将 $add 与 $asArray 一起使用时,$add 应该执行“推送”。但相反,它创建了一个哈希键而不是数字索引。
因此,dummy: test 有一个包含哈希键的父级。预期是一个数字索引,我的意思是:数组项。
有人可以给我一些帮助吗?我在这个数据库中只有 1 周的经验。
结果是这个……
screens
...0
.......days
..........0
..........1
..........2
.........-JrT5ZATDELIR3gXAvah
................dummy: test