INNER CODE UNIT · JavaScript

createMultipleListings

mongodb-developer/nodejs-quickstart · create.js:84

async function createMultipleListings(client, newListings){
    // See https://mongodb.github.io/node-mongodb-native/3.6/api/Collection.html#insertMany for the insertMany() docs
    const result = await client.db("sample_airbnb").collection("listingsAndReviews").insertMany(newListings);

    console.log(`${result.insertedCount} new listing(s) created with the following id(s):`);
    console.log(result.insertedIds);
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…