ravendb / ravendb-nodejs-client

RavenDB node.js client
MIT License
63 stars 32 forks source link

Streaming not Working #424

Closed tzarger closed 3 months ago

tzarger commented 4 months ago

Hello, with v5.2.7 streaming works, with v5.4.2 streaming immediately responds as done with 0 results.

This is the code:

    const entities: Draw[] = [];
    const reader = await session.advanced.stream<Draw>(session.query<Draw>({ collection: 'Draws' }));

    reader.on('data', (data) => {
      entities.push(data.document);
    });

    await StreamUtil.finishedAsync(reader);

Also, I had to import StreamUtil like, because Typescript cannot seem to find it and don't believe it is exported as StreamUtil: import * as StreamUtil from 'ravendb/dist/Utility/StreamUtil';

I am using RavenDB Server v5.4.2

Since my code worked with v.5.2.7 ... it seems there was a change. Is it because of my Server version?

ml054 commented 4 months ago

Hi @tzarger

In RavenDB 5.4 client we introduced faster way of streaming using jsonl.

Please notice that you are using very old version of RavenDB server (relased on 2022/09/01) which lacks this feature.

I'd suggest either:

convensions.useJsonlStreaming = false;

On your DocumentConventions object.

I hope it helps.

tzarger commented 4 months ago

@ml054 Thank you for your update. I was suspecting it might be related to the older version I am using.

Are there any known issues upgrading from v5.4.2 to the latest as the server is a production server...

ayende commented 4 months ago

There are no issues with the upgrade that we are aware of. Note that in general, if you have one server, that won't be a high availability upgrade

ml054 commented 3 months ago

@tzarger can we close this issue or there is anything else we can help?

tzarger commented 3 months ago

Yes you and close.

Thank you.

Troy Sent from my iPhone

On Apr 25, 2024, at 11:55 AM, Marcin Lewandowski @.***> wrote:



@tzargerhttps://github.com/tzarger can we close this issue or there is anything else we can help?

— Reply to this email directly, view it on GitHubhttps://github.com/ravendb/ravendb-nodejs-client/issues/424#issuecomment-2077629055, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AANNDFJ2VW3GIPYKUQXHBV3Y7ERNPAVCNFSM6AAAAABGJB35LCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZXGYZDSMBVGU. You are receiving this because you were mentioned.Message ID: @.***>