Optional chunkThe number of documents to upload per request. Defaults to 20.
If you have large documents, you may find it beneficial to reduce this number and increase concurrency to improve throughput. Leave it unspecified (recommended) to use the system default.
20
Optional maxThe maximum time to wait for a response from the server, in milliseconds.
If true, the documents are inserted in the order provided. If an error occurs, the operation stops and the
remaining documents are not inserted.
Optional vectorizeAkin to InsertManyOrderedOptions.vectors, but for $vectorize.
*
*
$vectorize fields in the docs directlyOptional vectorsA list of optional vectors to use for the documents, if using a vector-enabled collection.
This is purely for the user's convenience and intuitiveness—it is equivalent to setting the $vector field on the
documents themselves. The two are interchangeable, but mutually exclusive.
The list may contain null or undefined values, which mark the corresponding document as not having a vector
(or the doc having its $vector field already set).
NB. Setting this field will cause a shallow copy of the documents to be made for non-null vectors. If
performance is a concern, it is recommended to directly set the $vector field on the document itself.
If any document already has a $vector field, and this is set, the $vector field will be overwritten. It is
up to the user to ensure that both fields are not set at once.
$vector fields in the docs directly
Options for insertMany when
orderedistrue.Field
ordered - If
true, the documents are inserted sequentially in the order provided.Field
chunkSize - The number of documents to upload per request. Defaults to 20.
Field
maxTimeMS - The maximum time to wait for a response from the server, in milliseconds.
See
Collection.insertMany