Insert documents
Inserts multiple documents into a collection.
Documents are stored in collections. They represent a single row or record of data in Astra DB Serverless databases. For more information, see About collections with the Data API.
If the collection is vector-enabled, pregenerated vector embeddings can be included by using the reserved $vector
field for each document.
If the collection has vectorize enabled, vector embeddings can be automatically generated from text specified in the reserved $vectorize
field for each document.
You can later use the $vector
or $vectorize
field to perform a vector search or hybrid search.
If the collection has lexical enabled, use the reserved $lexical
field to store the text to index for the lexical search component of hybrid search.
Alternatively, you can use the $hybrid
shorthand to populate the $vectorize
and $lexical
fields.
Method signature
-
Python
-
TypeScript
-
Java
-
curl
The following method belongs to the astrapy.Collection
class.
insert_many(
documents: Iterable[Dict[str, Any]],
*,
ordered: bool,
chunk_size: int,
concurrency: int
general_method_timeout_ms: int,
request_timeout_ms: int,
timeout_ms: int,
) -> CollectionInsertManyResult
The following method belongs to the Collection
class.
async insertMany(
documents: MaybeId<Schema>[],
options?: {
ordered?: boolean,
concurrency?: number,
chunkSize?: number,
timeout?: number | TimeoutDescriptor,
},
): CollectionInsertManyResult<Schema>
The following methods belong to the com.datastax.astra.client.Collection
class.
CollectionInsertManyResult insertMany(
List<? extends T> documents
)
CollectionInsertManyResult insertMany(
List<? extends T> documents,
CollectionInsertManyOptions options
)
curl -sS -L -X POST "ASTRA_DB_API_ENDPOINT/api/json/v1/ASTRA_DB_KEYSPACE/COLLECTION_NAME" \
--header "Token: ASTRA_DB_APPLICATION_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"insertMany": {
"documents": DOCUMENTS_JSON_ARRAY,
"options": {
"ordered": BOOLEAN,
}
}
}'
Result
-
Python
-
TypeScript
-
Java
-
curl
Inserts the specified documents and returns a CollectionInsertManyResult
object that includes the IDs of the inserted documents and details about the success of the operation.
The ID value depends on the ID type. For more information, see Document IDs.
Example response:
CollectionInsertManyResult(inserted_ids=[
"3f557bef-fd53-47ea-957b-effd53c7eaec",
101,
"132ffr343"
], raw_results=...)
Inserts the specified documents and returns a promise that resolves to a CollectionInsertManyResult<Schema>
object that includes the IDs of the inserted documents and the number of inserted documents.
The ID value depends on the ID type. For more information, see Document IDs.
Example response:
{
insertedCount: 3,
insertedIds: [
'92b3c4f4-db44-4440-b4c4-f4db54e440b8',
101,
'132ffr343',
]
}
Inserts the specified documents and returns a wrapper (CollectionInsertManyResult
) that includes the IDs of the inserted documents.
The ID value depends on the ID type. For more information, see Document IDs.
Inserts the specified documents and returns a JSON object that includes the IDs of the inserted documents.
The ID value depends on the ID type. For more information, see Document IDs.
Example response:
{
"status": {
"insertedIds": [
"3f557bef-fd53-47ea-957b-effd53c7eaec",
101,
"132ffr343"
]
}
}
Parameters
-
Python
-
TypeScript
-
Java
-
curl
Name | Type | Summary |
---|---|---|
|
|
An iterable of dictionaries, with each dictionary describing a document to insert. In addition to open-ended fields that you can specify for each document, you may also specify the following reserved fields:
The document may not contain both a If the document uses |
|
|
Optional.
Whether the insertions must be processed sequentially.
If Default: |
|
|
Optional. The number of documents to include in a single API request. DataStax recommends leaving this parameter unspecified to use the system default. Maximum: Default: |
|
|
Optional. The maximum number of concurrent requests to the API at a given time. If Default: |
|
|
Optional. The maximum time, in milliseconds, that the whole operation, which may involve multiple HTTP requests, can take. Default: The default value for the collection. This default is 30 seconds unless you specified a different default when you initialized the This parameter is aliased as |
|
|
Optional. The maximum time, in milliseconds, that the client should wait for each underlying HTTP request. Default: The default value for the collection. This default is 10 seconds unless you specified a different default when you initialized the |
Name | Type | Summary |
---|---|---|
|
An array of documents to insert. In addition to open-ended fields that you can specify for each document, you may also specify the following reserved fields:
The document may not contain both a If the document uses |
|
|
Optional.
The options for this operation. See the |
Name | Type | Summary |
---|---|---|
|
Optional.
Whether the insertions must be processed sequentially.
If |
|
|
Optional. The maximum number of concurrent requests to the API at a given time. If Default: |
|
|
Optional. The number of documents to include in a single API request. DataStax recommends leaving this parameter unspecified to use the system default. Maximum: Default: |
|
|
|
Optional. The timeout(s) to apply to this method.
You can specify Details about the
|
Name | Type | Summary |
---|---|---|
|
|
A list of objects describing the documents to insert. In addition to open-ended fields that you can specify for each document, you may also specify the following reserved fields:
The document may not contain both a If the document uses |
|
Optional.
The options for this operation. See the methods of the |
Name | Type | Summary |
---|---|---|
|
|
Optional.
Whether the insertions must be processed sequentially.
If |
|
|
Optional. The maximum number of concurrent requests to the API at a given time. If Default: |
|
|
Optional. The number of documents to include in a single API request. DataStax recommends leaving this parameter unspecified to use the system default. Maximum: Default: |
|
|
Optional. The maximum time, in milliseconds, that the client should wait for each underlying HTTP request. Default: The default value for the collection. This default is 30 seconds unless you specified a different default when you initialized the |
Use the insertMany
command with these parameters:
Name | Type | Summary |
---|---|---|
|
|
An array of JSON objects describing the documents to insert. In addition to open-ended fields that you can specify for each document, you may also specify the following reserved fields:
The document may not contain both a If the document uses |
|
|
Optional.
The options for this operation. See the |
Name | Type | Summary |
---|---|---|
|
|
Optional.
Whether the insertions must be processed sequentially.
If Default: |
Examples
The following examples demonstrate how to insert multiple documents into a collection.
Insert documents
The documents can have different structures.
-
Python
-
TypeScript
-
Java
-
curl
from astrapy import DataAPIClient
# Get an existing collection
client = DataAPIClient()
database = client.get_database(
"ASTRA_DB_API_ENDPOINT",
token="ASTRA_DB_APPLICATION_TOKEN",
)
collection = database.get_collection("COLLECTION_NAME")
# Insert documents into the collection
result = collection.insert_many([
{
"name": "Jane Doe",
"age": 42,
},
{
"nickname": "Bobby",
"color": "blue",
"foods": ["carrots", "chocolate"],
},
])
import { DataAPIClient, CollectionInsertManyError } from '@datastax/astra-db-ts';
// Get an existing collection
const client = new DataAPIClient('ASTRA_DB_APPLICATION_TOKEN');
const database = client.db('ASTRA_DB_API_ENDPOINT');
const collection = database.collection('COLLECTION_NAME');
// Insert documents into the collection
(async function () {
try {
const result = await collection.insertMany([
{
name: 'Jane Doe',
age: 42,
},
{
nickname: "Bobby",
color: "blue",
foods: ["carrots", "chocolate"],
}
]);
} catch (error) {
if (error instanceof CollectionInsertManyError) {
console.log(error.insertedIds());
}
}
})();
package com.examples;
import com.datastax.astra.client.collections.Collection;
import com.datastax.astra.client.DataAPIClient;
import com.datastax.astra.client.collections.definition.documents.Document;
import com.datastax.astra.client.collections.commands.results.CollectionInsertManyResult;
public class InsertMany {
public static void main(String[] args) {
// Get an existing collection
Collection<Document> collection = new DataAPIClient("ASTRA_DB_APPLICATION_TOKEN")
.getDatabase("ASTRA_DB_API_ENDPOINT")
.getCollection("COLLECTION_NAME");
// Insert documents to the collection
Document document1 = new Document()
.append("name", "Jane Doe")
.append("age", 42);
Document document2 = new Document()
.append("nickname", "Bobby")
.append("color", "blue")
.append("foods", Arrays.asList("carrots", "chocolate"));
CollectionInsertManyResult result = collection.insertMany(List.of(document1, document2));
System.out.println("IDs inserted: " + result.getInsertedIds());
}
}
curl -sS -L -X POST "ASTRA_DB_API_ENDPOINT/api/json/v1/ASTRA_DB_KEYSPACE/COLLECTION_NAME" \
--header "Token: ASTRA_DB_APPLICATION_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"insertMany": {
"documents": [
{
"name": "Jane Doe",
"age": 42
},
{
"nickname": "Bobby",
"color": "blue",
"foods": ["carrots", "chocolate"]
}
]
}
}'
Insert documents with vector embeddings
Use the reserved $vector
field to insert documents with pregenerated vector embeddings.
The $vector
field is only supported for vector-enabled collections.
For more information, see $vector and $vectorize in collections.
You may also insert a mix of documents with and without the $vector
field.
-
Python
-
TypeScript
-
Java
-
curl
from astrapy import DataAPIClient
from astrapy.data_types import DataAPIVector
# Get an existing collection
client = DataAPIClient()
database = client.get_database(
"ASTRA_DB_API_ENDPOINT",
token="ASTRA_DB_APPLICATION_TOKEN",
)
collection = database.get_collection("COLLECTION_NAME")
# Insert documents to the collection
# The following also demonstrates use of both plain lists and DataAPIVector
result = collection.insert_many([
{
"name": "Jane Doe",
"age": 42,
"$vector": [.45, .32, .31]
},
{
"nickname": "Bobby",
"$vector": DataAPIVector([.08, .68, .30]),
},
])
import { DataAPIClient, CollectionInsertManyError } from '@datastax/astra-db-ts';
// Get an existing collection
const client = new DataAPIClient('ASTRA_DB_APPLICATION_TOKEN');
const database = client.db('ASTRA_DB_API_ENDPOINT');
const collection = database.collection('COLLECTION_NAME');
// Insert documents into the collection
(async function () {
try {
const result = await collection.insertMany([
{
name: 'Jane Doe',
age: 42,
$vector: [.45, .32, .31],
},
{
nickname: "Bobby",
$vector: [.08, .68, .30],
}
]);
} catch (error) {
if (error instanceof CollectionInsertManyError) {
console.log(error.insertedIds());
}
}
})();
package com.examples;
import com.datastax.astra.client.collections.Collection;
import com.datastax.astra.client.core.vector.DataAPIVector;
import com.datastax.astra.client.DataAPIClient;
import com.datastax.astra.client.collections.definition.documents.Document;
import com.datastax.astra.client.collections.commands.results.CollectionInsertManyResult;
public class InsertMany {
public static void main(String[] args) {
// Get an existing collection
Collection<Document> collection = new DataAPIClient("ASTRA_DB_APPLICATION_TOKEN")
.getDatabase("ASTRA_DB_API_ENDPOINT")
.getCollection("COLLECTION_NAME");
// Insert documents to the collection
Document document1 = new Document()
.append("name", "Jane Doe")
.append("age", 42)
.append("$vector", new DataAPIVector(new float[] {0.45f, 0.32f, 0.41f}));
Document document2 = new Document()
.append("nickname", "Bobby")
.append("$vector", new DataAPIVector(new float[] {0.08f, 0.68f, 0.3f}));
CollectionInsertManyResult result = collection.insertMany(List.of(document1, document2));
System.out.println("IDs inserted: " + result.getInsertedIds());
}
}
You can provide the vector embeddings as an array of floats, or you can use $binary
to provide the vector embeddings as a Base64-encoded string.
$binary
can be more performant.
-
Array of floats
-
$binary
curl -sS -L -X POST "ASTRA_DB_API_ENDPOINT/api/json/v1/ASTRA_DB_KEYSPACE/COLLECTION_NAME" \
--header "Token: ASTRA_DB_APPLICATION_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"insertMany": {
"documents": [
{
"name": "Jane Doe",
"age": 42,
"$vector": [.12, .52, .32]
},
{
"nickname": "Bobby",
"$vector": [0.3, 0.6, 0.5]
}
]
}
}'
curl -sS -L -X POST "ASTRA_DB_API_ENDPOINT/api/json/v1/ASTRA_DB_KEYSPACE/COLLECTION_NAME" \
--header "Token: ASTRA_DB_APPLICATION_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"insertMany": {
"documents": [
{
"name": "Jane Doe",
"age": 42,
"$vector": {"$binary": "PfXCjz8FHrg+o9cK"}
},
{
"nickname": "Bobby",
"$vector": {"$binary": "PpmZmj8ZmZo/AAAA"}
}
]
}
}'
Insert documents and generate vector embeddings
Use the reserved $vectorize
field to generate a vector embedding automatically. The value of $vectorize
can be any string.
The $vectorize
field is only supported for collections that have vectorize enabled.
For more information, see $vector and $vectorize in collections and Auto-generate embeddings with vectorize.
You may also insert a mix of documents with and without the $vectorize
field.
-
Python
-
TypeScript
-
Java
-
curl
from astrapy import DataAPIClient
# Get an existing collection
client = DataAPIClient()
database = client.get_database(
"ASTRA_DB_API_ENDPOINT",
token="ASTRA_DB_APPLICATION_TOKEN",
)
collection = database.get_collection("COLLECTION_NAME")
# Insert documents into the collection
result = collection.insert_many([
{
"name": "Jane Doe",
"age": 42,
"$vectorize": "Text to vectorize for this document",
},
{
"nickname": "Bobby",
"$vectorize": "Text to vectorize for this document",
},
])
import { DataAPIClient, CollectionInsertManyError } from '@datastax/astra-db-ts';
// Get an existing collection
const client = new DataAPIClient('ASTRA_DB_APPLICATION_TOKEN');
const database = client.db('ASTRA_DB_API_ENDPOINT');
const collection = database.collection('COLLECTION_NAME');
// Insert documents into the collection
(async function () {
try {
const result = await collection.insertMany([
{
name: 'Jane Doe',
age: 42,
$vectorize: "Text to vectorize for this document",
},
{
nickname: "Bobby",
$vectorize: "Text to vectorize for this document",
}
]);
} catch (error) {
if (error instanceof CollectionInsertManyError) {
console.log(error.insertedIds());
}
}
})();
package com.examples;
import com.datastax.astra.client.collections.Collection;
import com.datastax.astra.client.DataAPIClient;
import com.datastax.astra.client.collections.definition.documents.Document;
import com.datastax.astra.client.collections.commands.results.CollectionInsertManyResult;
public class InsertMany {
public static void main(String[] args) {
// Get an existing collection
Collection<Document> collection = new DataAPIClient("ASTRA_DB_APPLICATION_TOKEN")
.getDatabase("ASTRA_DB_API_ENDPOINT")
.getCollection("COLLECTION_NAME");
// Insert documents into the collection
Document document1 = new Document()
.append("name", "Jane Doe")
.append("age", 42)
.append("$vectorize", "Text to vectorize for this document");
Document document2 = new Document()
.append("nickname", "Bobby")
.append("$vectorize", "Text to vectorize for this document");
CollectionInsertManyResult result = collection.insertMany(List.of(document1, document2));
System.out.println("IDs inserted: " + result.getInsertedIds());
}
}
curl -sS -L -X POST "ASTRA_DB_API_ENDPOINT/api/json/v1/ASTRA_DB_KEYSPACE/COLLECTION_NAME" \
--header "Token: ASTRA_DB_APPLICATION_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"insertMany": {
"documents": [
{
"name": "Jane Doe",
"age": 42,
"$vectorize": "Text to vectorize for this document"
},
{
"nickname": "Bobby",
"$vectorize": "Text to vectorize for this document"
}
]
}
}'
Insert documents for retrieval with hybrid search
Hybrid search, lexical search, and reranking are currently in public preview. Development is ongoing, and the features and functionality are subject to change. Astra DB Serverless, and the use of such, is subject to the DataStax Preview Terms. |
If you plan to use hybrid search to find documents, each document must have both the $lexical
field and the $vector
field populated.
-
Python
-
TypeScript
-
Java
-
curl
from astrapy import DataAPIClient
# Get an existing collection
client = DataAPIClient("ASTRA_DB_APPLICATION_TOKEN")
database = client.get_database("ASTRA_DB_API_ENDPOINT")
collection = database.get_collection("COLLECTION_NAME")
# Insert documents
result = collection.insert_many([
{
"name": "Jane Doe",
"$vector": [.08, .68, .30],
"$lexical": "Text for lexical search",
},
{
"name": "Mary Day",
"$vectorize": "Text for vector search",
"$lexical": "Text for lexical search",
},
{
"name": "Bobby",
"$hybrid": "Common text for both vectorize and lexical search",
},
])
import { DataAPIClient, CollectionInsertManyError } from '@datastax/astra-db-ts';
// Get an existing collection
const client = new DataAPIClient('ASTRA_DB_APPLICATION_TOKEN');
const database = client.db('ASTRA_DB_API_ENDPOINT');
const collection = database.collection('COLLECTION_NAME');
// Insert documents into the collection
(async function () {
try {
const result = await collection.insertMany([
{
name: 'Jane Doe',
$vector: [.08, .68, .30],
$lexical: "Text for lexical search",
},
{
name: 'Mary Day',
$vectorize: "Text for vector search",
$lexical: "Text for lexical search",
},
{
name: 'Bobby',
$hybrid: "Common text for both vectorize and lexical search",
}
]);
} catch (error) {
if (error instanceof CollectionInsertManyError) {
console.log(error.insertedIds());
}
}
})();
import com.datastax.astra.client.DataAPIClient;
import com.datastax.astra.client.collections.Collection;
import com.datastax.astra.client.collections.definition.documents.Document;
import com.datastax.astra.client.core.hybrid.Hybrid;
import com.datastax.astra.client.core.vector.DataAPIVector;
public class InsertMany {
public static void main(String[] args) {
// Get an existing collection
Collection<Document> collection = new DataAPIClient("ASTRA_DB_APPLICATION_TOKEN")
.getDatabase("ASTRA_DB_API_ENDPOINT")
.getCollection("COLLECTION_NAME");
Document document1 = new Document().append("name", "John Doe")
.append("$vector", new DataAPIVector(new float[] {0.45f, 0.32f, 0.41f}))
.append("$lexical", "Text for lexical search");
Document document2 = new Document().append("name", "Mary Day")
.append("$vectorize", "Text for vector search")
.append("$lexical", "Text for lexical search");
Document document3 = new Document().append("name", "'Bobby'")
.append("$hybrid", "Common text for both vectorize and lexical search");
collection.insertMany(document1, document2, document3);
}
}
curl -sS -L -X POST "ASTRA_DB_API_ENDPOINT/api/json/v1/ASTRA_DB_KEYSPACE/COLLECTION_NAME" \
--header "Token: ASTRA_DB_APPLICATION_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"insertMany": {
"documents": [
{
"name": "Jane Doe",
"$vector": [.08, .68, .30],
"$lexical": "Text for lexical search"
},
{
"name": "Mary Day",
"$vectorize": "Text for vector search",
"$lexical": "Text for lexical search"
},
{
"name": "Bobby",
"$hybrid": "Common text for both vectorize and lexical search"
}
]
}
}'
Insert documents and specify the IDs
-
Python
-
TypeScript
-
Java
-
curl
from astrapy import DataAPIClient
# Get an existing collection
client = DataAPIClient()
database = client.get_database(
"ASTRA_DB_API_ENDPOINT",
token="ASTRA_DB_APPLICATION_TOKEN",
)
collection = database.get_collection("COLLECTION_NAME")
# Insert documents into the collection
result = collection.insert_many([
{
"name": "Jane Doe",
"_id": 1,
},
{
"nickname": "Bobby",
"_id": "b_023",
},
])
import { DataAPIClient, CollectionInsertManyError } from '@datastax/astra-db-ts';
// Get an existing collection
const client = new DataAPIClient('ASTRA_DB_APPLICATION_TOKEN');
const database = client.db('ASTRA_DB_API_ENDPOINT');
const collection = database.collection('COLLECTION_NAME');
// Insert documents into the collection
(async function () {
try {
const result = await collection.insertMany([
{
name: 'Jane Doe',
_id: 1,
},
{
nickname: "Bobby",
_id: '23'
}
]);
} catch (error) {
if (error instanceof CollectionInsertManyError) {
console.log(error.insertedIds());
}
}
})();
package com.examples;
import com.datastax.astra.client.collections.Collection;
import com.datastax.astra.client.DataAPIClient;
import com.datastax.astra.client.collections.definition.documents.Document;
import com.datastax.astra.client.collections.commands.results.CollectionInsertManyResult;
public class InsertMany {
public static void main(String[] args) {
// Get an existing collection
Collection<Document> collection = new DataAPIClient("ASTRA_DB_APPLICATION_TOKEN")
.getDatabase("ASTRA_DB_API_ENDPOINT")
.getCollection("COLLECTION_NAME");
// Insert documents to the collection
Document document1 = new Document(1)
.append("name", "Jane Doe");
Document document2 = new Document("23")
.append("nickname", "Bobby");
CollectionInsertManyResult result = collection.insertMany(List.of(document1, document2));
System.out.println("IDs inserted: " + result.getInsertedIds());
}
}
curl -sS -L -X POST "ASTRA_DB_API_ENDPOINT/api/json/v1/ASTRA_DB_KEYSPACE/COLLECTION_NAME" \
--header "Token: ASTRA_DB_APPLICATION_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"insertMany": {
"documents": [
{
"name": "Jane Doe",
"_id": 1
},
{
"nickname": "Bobby",
"_id": "23"
}
]
}
}'
Insert documents and specify insertion behavior
-
Python
-
TypeScript
-
Java
-
curl
from astrapy import DataAPIClient
# Get an existing collection
client = DataAPIClient()
database = client.get_database(
"ASTRA_DB_API_ENDPOINT",
token="ASTRA_DB_APPLICATION_TOKEN",
)
collection = database.get_collection("COLLECTION_NAME")
# Insert documents into the collection
result = collection.insert_many(
[
{
"name": "Jane Doe",
"age": 42,
},
{
"nickname": "Bobby",
"color": "blue",
"foods": ["carrots", "chocolate"],
},
],
chunk_size=2,
concurrency=2,
ordered=False,
general_method_timeout_ms=1000,
)
import { DataAPIClient, CollectionInsertManyError } from '@datastax/astra-db-ts';
// Get an existing collection
const client = new DataAPIClient('ASTRA_DB_APPLICATION_TOKEN');
const database = client.db('ASTRA_DB_API_ENDPOINT');
const collection = database.collection('COLLECTION_NAME');
// Insert documents into the collection
(async function () {
try {
const result = await collection.insertMany(
[
{
name: 'Jane Doe',
age: 42,
},
{
nickname: "Bobby",
color: "blue",
foods: ["carrots", "chocolate"],
}
],
{
chunkSize: 2,
concurrency: 2,
ordered: false,
}
);
} catch (error) {
if (error instanceof CollectionInsertManyError) {
console.log(error.insertedIds());
}
}
})();
package com.examples;
import com.datastax.astra.client.collections.Collection;
import com.datastax.astra.client.DataAPIClient;
import com.datastax.astra.client.collections.definition.documents.Document;
import com.datastax.astra.client.collections.commands.options.CollectionInsertManyOptions;
import com.datastax.astra.client.collections.commands.results.CollectionInsertManyResult;
public class InsertMany {
public static void main(String[] args) {
// Get an existing collection
Collection<Document> collection = new DataAPIClient("ASTRA_DB_APPLICATION_TOKEN")
.getDatabase("ASTRA_DB_API_ENDPOINT")
.getCollection("COLLECTION_NAME");
// Define the insertion options
CollectionInsertManyOptions options = new CollectionInsertManyOptions()
.chunkSize(20)
.concurrency(3)
.ordered(false)
.timeout(1000);
// Insert documents into the collection
Document document1 = new Document()
.append("name", "Jane Doe")
.append("age", 42);
Document document2 = new Document()
.append("nickname", "Bobby")
.append("color", "blue")
.append("foods", Arrays.asList("carrots", "chocolate"));
CollectionInsertManyResult result = collection.insertMany(List.of(document1, document2), options);
System.out.println("IDs inserted: " + result.getInsertedIds());
}
}
curl -sS -L -X POST "ASTRA_DB_API_ENDPOINT/api/json/v1/ASTRA_DB_KEYSPACE/COLLECTION_NAME" \
--header "Token: ASTRA_DB_APPLICATION_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"insertMany": {
"documents": [
{
"name": "Jane Doe",
"age": 42
},
{
"nickname": "Bobby",
"color": "blue",
"foods": ["carrots", "chocolate"]
}
],
"options": {
"ordered": false
}
}
}'
Client reference
-
Python
-
TypeScript
-
Java
-
curl
For more information, see the client reference.
For more information, see the client reference.
For more information, see the client reference.
Client reference documentation is not applicable for HTTP.