我想将大部分项推到数组中,但不包括某些项
我希望将所有状态都推送到数组中,除了一些项
这是我的状态:
state = {
username: '..',
date: '..',
time: '..',
description: '..',
images: '..',
buildingNumber: '..',
status: '..',
serviceDB: '..',
snapshotKey: '..', // i don't need this when pushed
count: -1, // i don't need this when pushed
};
这是我的代码
let order = [];
order.push(this.state);
console.log(order); it's log all state
// I want to push it to DB
database()
.ref(`Providers/ProvidersOrders/${uid}`)
.push(...order);
};
const { snapshotKey, count, ...filteredData } = this.state;
- Emile Bergeron