how to read data in firestore

0

Hello. I am trying for a simple rule in the firestore but I do not have enough knowledge for this, someone could help me. my service is following the firestore documentation on google.

 constructor(
  private afs: AngularFirestore ) {
    this.clienteCollection = this.afs.collection('clientes', ref => ref.where("author", "==", this.user.uid));
   }

My rules are these:

service cloud.firestore {match /databases/{database}/documents {
match /clientes/{clientes} {
  allow read, write: if request.auth.uid == resource.data.author; } } }

using this way I get the error saying

ERROR in src / app / services / client.service.ts (6,1): error TS1202: Import assignment can not be used when targeting ECMAScript modules. Consider using 'import' as ns from 'mod', 'import' from 'mod', 'import d from' mod '', or another module format instead. src / app / services / client.service.ts (19,104): error TS2339: Property 'user' does not exist on type 'ClientService'.

I have tried to declare the user but it brings an error where uid does not exist.

If anyone can help me from now on thanks.

    
asked by anonymous 19.09.2018 / 01:34

0 answers