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
| function getDates(startDate, endDate) { | |
| let currentDate = new Date(startDate); | |
| let tomorrow = new Date(currentDate); | |
| tomorrow.setDate(tomorrow.getDate() + 1); | |
| const dates = []; | |
| while (currentDate < endDate) { | |
| dates.push({ | |
| startDate: new Date(currentDate), | |
| endDate: new Date(tomorrow) | |
| }); |
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
| use admin; | |
| db.runCommand( { "storageSetConfig": { | |
| "stores": [{ | |
| "name": "mdb-dl-example", // Creates an S3 store | |
| "provider": "s3", // Specifies the provider | |
| "region":"eu-west-1", // Update with the bucket region code | |
| "bucket": "md-dl-example" // Update with your bucket name | |
| }], | |
| "databases": [{ | |
| "name": "sample", // Creates a database named sample |
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
| sam local invoke -d 9999 --env-vars env.json --event event.json |
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
| sam local start-api -d 9999 --env-vars env.json |
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
| { | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "name": "Attach to SAM CLI", | |
| "type": "node", | |
| "request": "attach", | |
| "address": "localhost", | |
| "port": 9999, | |
| "localRoot": "${workspaceRoot}", |
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
| let my_object = [ | |
| { | |
| value: "", | |
| class: "A" | |
| }, | |
| { | |
| value: "", | |
| class: "B" | |
| }, | |
| { |
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
| // Books Schema | |
| var bookSchema = new Schema({ | |
| name: String, | |
| postedBy: {type: mongoose.Schema.Types.ObjectId, ref: 'User'}, | |
| dateCreated: Date, | |
| }); | |
| // Registering Schema | |
| var Book = mongoose.model('Books', bookSchema); |