Hi Christopher,

I think it is because the observables returned by AngularFirestore never 
complete.
You can use the take operator to make it complete manually.
Regards,
Arnaud.



On Tuesday, 3 March 2020 22:29:59 UTC+1, Christopher de Vidal wrote:
>
> I worked around the problem by denormalizing but I'm curious if someone 
> has thoughts how it might have been solved originally.
>
> New schema:
> /users/<username>/ABC123/name = 'Near the house'
>
> On Tuesday, March 3, 2020 at 2:45:31 PM UTC-5, Christopher de Vidal wrote:
>>
>> Help a newbie? The Firebase Firestore users/<user> collection contains a 
>> serials subcollection that I assign to serials$. Each one of those fields 
>> is turned into a string for a query of the 'serials' collection in 
>> Firestore. But nothing is logging to the console. Please assist.
>>
>> Schema:
>> /users/<username>/serials = ['ABC123','ABC124','ABC125']
>> /serials/ABC123/friendly_name = 'Near the house'
>> /serials/ABC124/friendly_name = 'Side yard'
>>
>>   constructor(private afs: AngularFirestore) {
>>
>>     const serialsDocument = afs.doc<Serial>('users/cdevidal');
>>     const serials$ = serialsDocument.collection<Serial>('serials').
>> valueChanges();
>>     const friendly_names$ = serials$.pipe(
>>       map(serial_record => {
>>         console.log('typeof serial_record: ');
>>         console.log(typeof serial_record);
>>         console.log('serial_record: ');
>>         console.log(serial_record);
>>         return afs.doc<FriendlyName>('serials/' + serial_record['serial'
>> ]).valueChanges()
>>       })
>>     );
>>     friendly_names$.pipe(combineAll()).subscribe(friendly_names_records 
>> => {
>>       console.log('typeof friendly_names_records: ');
>>       console.log(typeof friendly_names_records);
>>       console.log('friendly_names_records: ');
>>       console.log(friendly_names_records);
>>     });
>>   }
>>
>>
>> typeof serial_record: 
>> object
>> serial_record: 
>> (3) [{…}, {…}, {…}]
>> 0: {serial: "ABC125"}
>> 1: {serial: "ABC124"}
>> 2: {serial: "ABC123"}
>> length: 3__proto__: Array(0)
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/2505e267-f8c3-4774-82e3-752a1d1f6a92%40googlegroups.com.

Reply via email to