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
var requestfile = window.indexedDB.open("file", 1); | |
var objectStore = db.transaction("photos").objectStore("photos"); | |
objectStore.getAll().onsuccess = function (event) { | |
console.log(event.target.result) | |
}; |
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
var request = window.indexedDB.open("photos", 1); | |
request.onsuccess = function (event) { | |
var db = event.target.result; | |
var request = db.transaction(["types"]).objectStore('types').get(1); | |
//get fonksiyonu sorguda kullanılacak değerimizi alıyor. Eğer primary key dışında sorgu yazmak istersek index kullanabiliriz. | |
request.onsuccess = function (event) { | |
console.log(request.result); | |
}; | |
} |
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
var request = window.indexedDB.open("photos", 1); | |
request.onsuccess = function (event) { | |
var db = event.target.result; | |
var objectStore = db.transaction("photos").objectStore("photos"); | |
var index = objectStore.index("name"); | |
//index üzerinden sorgumuzu çalıştıracağımız keyimizi belirtiyoruz. | |
index.get("kitten cat").onsuccess = function (event) { | |
console.log(event.target.result); | |
}; | |
} |
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
var request = window.indexedDB.open("photos", 1); | |
var request = db.transaction(["photos"], "readwrite") .objectStore("photos") | |
.delete(2); //bu değerimizi primary key değerine göre belirtiyoruz. yani id keyimiz. | |
request.onsuccess = function (event) { | |
console.log('deleted!'); | |
}; | |
} |
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
var objectStore = db.transaction(["files"], "readwrite").objectStore("files"); | |
var request = objectStore.get(1); | |
request.onsuccess = function(event) { | |
var data = event.target.result; | |
data.name = 'this is kitten cat' | |
var requestUpdate = objectStore.put(data); | |
requestUpdate.onerror = function(event) { | |
// Hata Anında | |
}; | |
requestUpdate.onsuccess = function(event) { |
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
<style> | |
.slider { | |
border-radius: 0.5rem; | |
margin: 1rem; | |
min-height: 15rem; | |
background: linear-gradient( | |
to right, | |
#314755, | |
#26a0da | |
); /* Default Background */ |
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
.slider .slide-item { | |
cursor: grabbing; | |
scroll-snap-align: start; | |
flex-shrink: 0; /* We don't want to fit divs to parent element. So we'll use flex-shrink: 0 */ | |
background-color: red; | |
width: 100%; | |
display: grid; | |
place-items: center; | |
font-size: 5rem; | |
} |
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
.slider { | |
border-radius: 0.5rem; | |
margin: 1rem; | |
min-height: 15rem; | |
background: linear-gradient( | |
to right, | |
#314755, | |
#26a0da | |
); /* Default Background */ | |
box-shadow: 8px 7px 10px rgba(0, 0, 0, 0.5); |
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
<div class="slider"> | |
<div class="slide-item" id="slide1"> | |
😥 | |
</div> | |
<div class="slide-item" id="slide2"> | |
🤔 | |
</div> | |
<div class="slide-item" id="slide3"> | |
🥺 | |
</div> |
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
exports = function(){ | |
return context.http.get({ url: "http://gd.geobytes.com/GetCityDetails" }) | |
.then(userInfo => { | |
const { geobytescountry, geobytesipaddress, geobytesfqcn } = EJSON.parse(userInfo.body.text()) | |
const result = context.services.get("mongodb-atlas").db("cuties").collection("logs").insertOne({ geobytescountry, geobytesipaddress, geobytesfqcn }); | |
return result | |
}) | |
}; |