【发布时间】:2019-12-12 02:58:42
【问题描述】:
我能够从 Firestore 上传和获取数据,但问题是删除收集的数据。下面是我的代码 我的服务
delete_AcBooking(record_id) {
return this.afirestore.doc(`users/${this.user.getUID()}/AcBooking` + record_id).delete();
}
组件.ts
RemoveRecord(rowID) {
this.bookingservice.delete_AcBooking(rowID);
}
错误
ERROR FirebaseError: Invalid document reference. Document references must have an even number of segments, but users/pht1VUEXbFfkD3udB9Q3cMwWtcH2/AcBookingLHF9Yj9JkoFpaUOsJtpd has 3
at new FirestoreError (http://localhost:4200/vendor.js:85176:28)
at Function.push../node_modules/@firebase/firestore/dist/index.cjs.js.DocumentReference.forPath (http://localhost:4200/vendor.js:105305:19)
at Firestore.push../node_modules/@firebase/firestore/dist/index.cjs.js.Firestore.doc (http://localhost:4200/vendor.js:105091:34)
at AngularFirestore.push../node_modules/@angular/fire/firestore/firestore.js.AngularFirestore.doc (http://localhost:4200/vendor.js:67496:34)
at BookingServiceService.push../src/app/service/booking-service.service.ts.BookingServiceService.delete_AcBooking (http://localhost:4200/main.js:5076:25)
at BookingsPage.push../src/app/pages/bookings/bookings.page.ts.BookingsPage.RemoveRecord (http://localhost:4200/pages-bookings-bookings-module.js:333:29)
at Object.eval [as handleEvent] (ng:///BookingsPageModule/BookingsPage.ngfactory.js:44:31)
at handleEvent (http://localhost:4200/vendor.js:65419:41)
at callWithDebugContext (http://localhost:4200/vendor.js:66489:25)
at Object.debugHandleEvent [as handleEvent] (http://localhost:4200/vendor.js:66216:12)
【问题讨论】:
-
旁注:您是否阅读过有关删除的文档?删除数据集有许多复杂性,不建议在客户端执行此操作。 docs
标签: angular typescript node-modules ionic4