What do you want to save?
Add Code snippet
New code examples
-
Other 2021-11-02 22:45:07
delete specific key from every subdocuments
var deleteIdFromSubdocs = function (obj, isRoot) { for (var key in obj) { if (isRoot == false && key == "_id") { delete obj[key]; } else if (typeof obj[key] == "object") { deleteIdFromSubdocs(obj[key], f... Add solution -
Other 2021-10-27 20:43:09
mongodb copy indexes from a server to another
db.getCollectionNames().forEach(function(collection) { indexes = db[collection].getIndexes(); indexes.forEach(function (c) { opt = '' ixkey = JSON.stringify(c.key, null, 1).replace(/(\r\n|\n|\r)/gm,"") ns = c.ns.substr(c.ns.indexOf("."... Add solution -
-
Javascript 2021-10-17 09:10:07
js check if string is number
//Updated dec 2020 // The first 2 Variations return a Boolean // They just work the opposite way around // IsInteger if (Number.isInteger(val)) { // It is indeed a number } // isNaN (is not a number) if (isNaN(val)) { // It is not a number } // Anoth... Add solution -
Javascript 2021-10-16 06:05:04
electron jquery
<script> if (typeof module === "object") { window.module = module; module = undefined; } </script> <script src="../assets/js/jquery-3.5.0.min.js"></script> <script src="../assets/js/script.js... Add solution