Skip to content

Instantly share code, notes, and snippets.

View spolat's full-sized avatar
🎯
~

Suat POLAT spolat

🎯
~
View GitHub Profile
@spolat
spolat / getDatesBetweenGivenRange.js
Last active July 23, 2020 00:51
Get dates between in two dates javascript
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)
});
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
sam local invoke -d 9999 --env-vars env.json --event event.json
sam local start-api -d 9999 --env-vars env.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to SAM CLI",
"type": "node",
"request": "attach",
"address": "localhost",
"port": 9999,
"localRoot": "${workspaceRoot}",
let my_object = [
{
value: "",
class: "A"
},
{
value: "",
class: "B"
},
{
// 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);