Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for batch record creation #88

Merged
merged 2 commits into from
Apr 25, 2019
Merged

Add support for batch record creation #88

merged 2 commits into from
Apr 25, 2019

Conversation

EvanHahn
Copy link
Contributor

@EvanHahn EvanHahn commented Apr 24, 2019

Note: batch record operations are currently beta. Please don't use this for production workflows yet.

This PR adds support for batch record creation. For example:

const table = airtable.base('app123').table('My Table');
const records = await table.create([
    {foo: 'boo'},
    {bar: 'yar'},
]);

console.log(records.length);        // => 2
console.log(records[0].get('foo')); // => 'boo'
console.log(records[1].get('bar')); // => 'yar'

The typecast option works the same as before:

await table.create([/* ... */], {typecast: true});

@EvanHahn EvanHahn requested review from kasrak and jbbakst April 24, 2019 19:12
@EvanHahn EvanHahn force-pushed the batch_create branch 2 times, most recently from a51da61 to 509c643 Compare April 25, 2019 15:08
For example:

    const table = airtable.base('app123').table('My Table');
    const records = await table.create([
        {foo: 'boo'},
        {bar: 'yar'},
    ]);

    console.log(records.length);         // => 2
    console.log(records[0].get('foo'));  // => 'boo'
    console.log(records[1].get('bar'));  // => 'yar'
@EvanHahn EvanHahn merged commit 4ee833f into master Apr 25, 2019
@EvanHahn EvanHahn deleted the batch_create branch April 25, 2019 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants