Skip to content

Commit a509296

Browse files
authored
Merge pull request #369 from ml054/RDBC-226
RDBC-226 Cannot bulk insert object literals with default conventions
2 parents 5518734 + 5665f49 commit a509296

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Documents/BulkInsertOperation.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ export class BulkInsertOperation {
285285

286286
private static _verifyValidId(id: string): void {
287287
if (StringUtil.isNullOrEmpty(id)) {
288-
throwError("InvalidArgumentException", "Document id must have a non empty value");
288+
throwError("InvalidArgumentException", "Document id must have a non empty value." +
289+
"If you want to store object literals with empty id, please register convention here: store.conventions.findCollectionNameForObjectLiteral");
289290
}
290291

291292
if (id.endsWith("|")) {
@@ -323,14 +324,14 @@ export class BulkInsertOperation {
323324
this._pipelineFinished = StreamUtil.pipelineAsync(this._currentWriter, this._requestBodyStream);
324325
this._currentWriter.push("[");
325326

326-
this._bulkInsertExecuteTask = Promise.all([
327+
this._bulkInsertExecuteTask = Promise.all([
327328
bulkCommandPromise,
328329
this._pipelineFinished
329330
]);
330331

331332
this._bulkInsertExecuteTask
332333
.catch(() => this._completedWithError = true);
333-
334+
334335
} catch (e) {
335336
throwError("RavenException", "Unable to open bulk insert stream.", e);
336337
}
@@ -813,7 +814,7 @@ export class BulkInsertCommand extends RavenCommand<void> {
813814

814815
const headers = this._headers().typeAppJson().build();
815816
// TODO: useCompression ? new GzipCompressingEntity(_stream) : _stream);
816-
return {
817+
return {
817818
method: "POST",
818819
uri,
819820
body: this._stream,

0 commit comments

Comments
 (0)