BulkImportResponse

From Ilianko

← Back to DP-420 Terminology Reference

Category: Server-Side Programming

Summary: Return object of the classic bulkImport stored procedure pattern; reports numDocsImported/continuation.

Overview

BulkImportResponse is the object returned by the classic 'bulkImport' stored procedure pattern in Azure Cosmos DB for NoSQL, typically containing a numDocsImported count (how many documents the invocation successfully inserted) and a continuation/continuationToken value indicating whether the stored procedure ran out of its execution time/RU budget before importing all documents in the batch. When continuation is present, the client must re-invoke the stored procedure with the remaining documents to complete the import, since a single stored procedure execution is bounded by a fixed time/RU budget within one logical partition. This pattern predates, and is largely superseded by, SDK-level Bulk Support for most modern scenarios.

More Info & Links

DP-420 Style Practice Questions

Q1. What does the numDocsImported field in a BulkImportResponse represent?

  • A. The number of documents successfully inserted during that stored procedure invocation
  • B. The total number of documents in the container
  • C. The number of documents that failed validation
  • D. The number of RUs consumed by the request

Q2. Why might a bulkImport stored procedure return a continuation value in its BulkImportResponse?

  • A. Because it ran out of its execution time/RU budget before importing all documents, requiring re-invocation for the remainder
  • B. Because the container's partition key was misconfigured
  • C. Because the client used the wrong consistency level
  • D. Because TTL expired on some documents during import

Answer Key

Answers are listed at the very end so you can attempt the questions first.

  • Q1 (BulkImportResponse): A. The number of documents successfully inserted during that stored procedure invocation — numDocsImported reports how many documents were successfully imported by that particular stored procedure execution.
  • Q2 (BulkImportResponse): A. Because it ran out of its execution time/RU budget before importing all documents, requiring re-invocation for the remainder — A stored procedure has a bounded execution time/RU budget within one logical partition; continuation signals that the client must call it again for remaining documents.

DP-420: Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB — term detail page