You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the readme you say collection can be an array or a generator function, but when i put a generator func in, it just loops infinite and the function actually gets never called:
As i read in another issue, i think this also will not be possible right? Because i get every data item from a file stream and of course have to wait until its here:
import{Query}from'https://esm.sh/mingo@6.1.2';asyncfunction*generatorStream(){console.log('generator start');yieldPromise.resolve({key: 1});yieldPromise.resolve({key: 2});yieldPromise.resolve({key: 3});}console.log('START');constquery=newQuery({key: 2});constcursor=query.find(generatorStream);console.log(awaitcursor.next());// for await (const result of cursor) {}console.log('END');
The text was updated successfully, but these errors were encountered:
You must invoke the generator. Since there is no general way to detect a generator, the user must explicitly initialize it. Also the library does not support async processing. Try the following.
console.log('START');constquery=newQuery({key: 2});constcursor=query.find(generatorStream());console.log(cursor.next());// for await (const result of cursor) {}console.log('END');
In the readme you say collection can be an array or a generator function, but when i put a generator func in, it just loops infinite and the function actually gets never called:
As i read in another issue, i think this also will not be possible right? Because i get every data item from a file stream and of course have to wait until its here:
The text was updated successfully, but these errors were encountered: