Closed patarapolw closed 3 years ago
These destroy the meaning of chaining. I cannot use Loki methods further.
console.log( zhDict .chain() .find({ entry: { $nin: ['尖嘴鱼'] } }) .mapReduce( (o: any) => { o._alt = o.alt ? o.alt.join('\x1f') : undefined return o }, (vs: any[]) => { const prev: any = [] vs.map((o) => { if (o._alt && ['開', '魚'].some((el) => o._alt.includes(el))) { prev.push(o) } }) return prev } ) ) // Is Array of data, not ResultSet console.log( zhDict.vocab.chain([ { type: 'mapReduce', mapFunction: (o) => { o._alt = o.alt ? o.alt.join('\x1f') : undefined return o }, reduceFunction: (vs: any[]) => { const prev: any = [] vs.map((o) => { if (o._alt && ['開', '魚'].some((el) => o._alt.includes(el))) { prev.push(o) } }) return prev }, }, ]) )
I see that I use string operations anyway, I am not use if I can use indices...
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
These destroy the meaning of chaining. I cannot use Loki methods further.
I see that I use string operations anyway, I am not use if I can use indices...