const collectionName = 'Students';
domo.post(`/domo/datastores/v2/collections/${collectionName}/documents/bulk`, [
{
content: {
name: 'Draco Malfoy',
house: 'Slytherin',
wand: { wood: 'hawthorn', core: 'unicorn hair', length: 10 },
courses: ['Potions', 'Transfiguration', 'Defense Against the Dark Arts'],
prefect: true
}
},
{
content: {
name: 'Luna Lovegood',
house: 'Ravenclaw',
courses: ['Charms', 'Defense Against the Dark Arts', 'Care of Magical Creatures']
}
}
]).then(result => console.log(result));
{
"Created": 2
}{
"status": 403,
"toe": "OK7MYQR2W9-49AOV-77KCS"
}{
"status": 404,
"statusReason": "DA0088: Invalid collection name: students",
"toe": "182LQAYFQ7-WJY65-XJLCA"
}Create Documents in Bulk
Create multiple documents in a given collection in a single HTTP request. Each document is limited to 2 MB.
POST
/
domo
/
datastores
/
v2
/
collections
/
{collectionName}
/
documents
/
bulk
const collectionName = 'Students';
domo.post(`/domo/datastores/v2/collections/${collectionName}/documents/bulk`, [
{
content: {
name: 'Draco Malfoy',
house: 'Slytherin',
wand: { wood: 'hawthorn', core: 'unicorn hair', length: 10 },
courses: ['Potions', 'Transfiguration', 'Defense Against the Dark Arts'],
prefect: true
}
},
{
content: {
name: 'Luna Lovegood',
house: 'Ravenclaw',
courses: ['Charms', 'Defense Against the Dark Arts', 'Care of Magical Creatures']
}
}
]).then(result => console.log(result));
{
"Created": 2
}{
"status": 403,
"toe": "OK7MYQR2W9-49AOV-77KCS"
}{
"status": 404,
"statusReason": "DA0088: Invalid collection name: students",
"toe": "182LQAYFQ7-WJY65-XJLCA"
}
