This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MongoDB connection | |
import { MongoClient } from 'mongodb'; // install package first | |
const { MONGODB_URI/* connection string*/, MONGODB_DB /*db name*/ } = process.env; | |
if (!MONGODB_URI) { | |
throw new Error( | |
'Please define the MONGODB_URI environment variable inside .env.local' | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
individual = { | |
_id : ObjectId("4f2978dfaa999d9db02618ce"), | |
AFN : '1XYK-KQJ', | |
name: { | |
first: ['john', 'johannes'], | |
middle: 'peter', | |
last: ['smith', 'sandvik'] | |
}, | |
events : [ |