Моя цель - позволить учащемуся зарегистрировать свой аккаунт в fb / google, введя ему код.
Как я структурировал данные
registration-code{
docId: {
code:'52400028'
}
}
provider.ts
checkIfRegistrationCodeExists(userTypedCode:string){
this.registrationCodeCollectionRef = this.afDb.collection('registration-code',
ref => ref.where('code', '==', userTypedCode));
this.registrationCodeCollection = this.registrationCodeCollectionRef.valueChanges();
}
Затем я проверяю, соответствует ли оно
checkIfRegistrationCodeExists(){
console.log(this.userTypedCode);
registrationCode.ts
this.registrationCodeProvider.checkIfRegistrationCodeExists(this.userTypedCode);
this.registrationCodeProvider.registrationCodeCollection.subscribe(code => {
if(code.length = 1){
console.log('Matched')
} else {
console.log('No matches');
}
})
}
Теперь моя проблема в том, как мне получить идентификатор документа для документав вопросе?
Какие-нибудь советы, как это сделать?Спасибо!