Skip to content

Commit c972a9a

Browse files
authored
Merge pull request #433 from ml054/v5.4
RavenDB-16050 Exporting query result to JSON - updating node.js client
2 parents 6a442f8 + c853126 commit c972a9a

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/Documents/Commands/QueryStreamCommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ export class QueryStreamCommand extends RavenCommand<StreamResultResponse> {
3030
}
3131

3232
public createRequest(node: ServerNode): HttpRequestParameters {
33-
const format = this._conventions.useJsonlStreaming ? 'jsonl' : 'json';
33+
const format = this._conventions.useJsonlStreaming ? 'format=jsonl' : "";
3434

3535
return {
3636
method: "POST",
37-
uri: `${node.url}/databases/${node.database}/streams/queries?format=${format}`,
37+
uri: `${node.url}/databases/${node.database}/streams/queries?${format}`,
3838
body: writeIndexQuery(this._conventions, this._indexQuery),
3939
headers: this._headers().typeAppJson().build()
4040
};

src/Documents/Session/Operations/StreamOperation.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,12 @@ export class StreamOperation {
4949
}
5050

5151
private _createRequestForIdPrefix(idPrefix: string, opts: StartingWithOptions): StreamCommand {
52-
const format = this._session.conventions.useJsonlStreaming ? 'jsonl' : 'json';
52+
const sb = new StringBuilder(`streams/docs?`);
53+
54+
if (this._session.conventions.useJsonlStreaming) {
55+
sb.append("format=jsonl&");
56+
}
5357

54-
const sb = new StringBuilder(`streams/docs?format=${format}&`);
5558
if (idPrefix) {
5659
sb.append("startsWith=")
5760
.append(encodeURIComponent(idPrefix)).append("&");

0 commit comments

Comments
 (0)