What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-11-22 03:27:21
event from changed style
var observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutationRecord) { console.log('style changed!'); }); }); var target = document.getElementById('myId'); observer.observe(target, { attributes : true, attri... Add solution -
Javascript 2021-11-19 02:45:10
react-mapbox-gl custom marker
// add markers to map geojson.features.forEach(function(marker) { // create a HTML element for each feature var el = document.createElement('div'); el.className = 'marker'; // make a marker for each feature and add to the map new mapboxgl.Mark... Add solution -
Javascript 2021-11-17 12:11:16
firebase get child value javascript
The value you extract is a regular JavaScript/JSON object, so you can access its members as you would do with any other JavaScript object. Your 1, 2, 3 level keys will be converted to an array by Firebase, which means it adds a null item at the start of t... Add solution -
Javascript 2021-11-14 21:43:22
node js get files in dir
//requiring path and fs modules const path = require('path'); const fs = require('fs'); //joining path of directory const directoryPath = path.join(__dirname, 'Documents'); //passsing directoryPath and callback function fs.readdir(directoryPath, functio... Add solution -
Javascript 2021-11-14 20:30:21
mongodb delete duplicate documents
var duplicates = []; db.collectionName.aggregate([ { $match: { name: { "$ne": '' } // discard selection criteria }}, { $group: { _id: { name: "$name"}, // can be grouped on multiple properties dups: { "$addTo... Add solution -
Javascript 2021-11-12 15:19:25
working with multiple db in single query mongodb
// Switch to admin database and get list of databases. db = db.getSiblingDB("admin"); dbs = db.runCommand({ "listDatabases": 1 }).databases; // Iterate through each database. dbs.forEach(function(database) { db = db.getSiblingDB(d... Add solution