0% found this document useful (0 votes)
3 views1 page

One

The document contains a JavaScript array named 'demoChats' that holds a series of chat messages between users, including Alice, Bob, Charlie, and Dave. Each chat entry includes the sender, recipient, message content, and a timestamp. The array is intended to be inserted into a database using a method that handles success and error responses.

Uploaded by

sp729710
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

One

The document contains a JavaScript array named 'demoChats' that holds a series of chat messages between users, including Alice, Bob, Charlie, and Dave. Each chat entry includes the sender, recipient, message content, and a timestamp. The array is intended to be inserted into a database using a method that handles success and error responses.

Uploaded by

sp729710
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

const demoChats = [

// { from: 'Alice', to: 'Bob', message: 'Hey Bob, how are you?', created_at: new
Date() },
// { from: 'Bob', to: 'Alice', message: 'Hi Alice, I’m good! How about you?',
created_at: new Date() },
// { from: 'Alice', to: 'Bob', message: 'I’m doing great, thanks! Want to catch
up later?', created_at: new Date() },
// { from: 'Bob', to: 'Alice', message: 'Sure! How about a video call this
evening?', created_at: new Date() },
// { from: 'Alice', to: 'Bob', message: 'Sounds good! I’ll send you a link
later.', created_at: new Date() },
// { from: 'Charlie', to: 'Dave', message: 'Hey Dave, are we still on for the
project meeting?', created_at: new Date() },
// { from: 'Dave', to: 'Charlie', message: 'Yes, looking forward to it! Let’s
meet at 2 PM.', created_at: new Date() },
// { from: 'Charlie', to: 'Dave', message: 'Perfect! I’ll see you then.',
created_at: new Date() },
];

//
chat.insertMany(demoChats).then((res)=>console.log(res)).catch((err)=>{console.log(
err)})

You might also like