Sorry for the typo : combineAll apply *combineLatest* when the observable 
of observable completes.


On Saturday, 7 March 2020 13:21:43 UTC+1, Arnaud Deman wrote:

> Hi Christopher,
>
> I am not completely sure. As the definition of combineAll is to apply 
> combineAll when the observervable of observable complete I would say here :
>
> return afs.doc<FriendlyName>('serials/' + 
> serial_record['serial']).valueChanges()*.pipe(take(1))*
>
> Regards,
> Arnaud
> *.*
>
> On Saturday, 7 March 2020 03:16:30 UTC+1, Christopher de Vidal wrote:
>>
>> Thanks for your reply. I'm new, where would I place take()? 
>>
>> On Wednesday, March 4, 2020 at 3:31:53 AM UTC-5, Arnaud Deman wrote:
>>>
>>> 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/8780dc1d-c9dd-41e6-8c44-c120fa7a4ba0%40googlegroups.com.

Reply via email to