pre update mongoose hook options ignored
This file contains 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
// based on http://onais-m.blogspot.nl/2014/10/automatic-graph-layout-with-javascript.html | |
var jsp = jsPlumb.getInstance(); | |
// construct dagre graph from JsPlumb graph | |
/* global dagre */ | |
var g = new dagre.graphlib.Graph(); | |
g.setGraph({nodesep:30,ranksep:30,marginx:50,marginy:50}); | |
g.setDefaultEdgeLabel(function() { return {}; }); | |
$('.xnode').each( |
This file contains 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
// find().count() vs find().limit(1).count() vs count() vs collection.count() | |
// Purpose was to detect if collections is empty or not. (That's why limit(1) is fine too) | |
const { performance } = require('perf_hooks'); | |
const fs = require('fs'); | |
const mongoose = require('mongoose'); | |
require('dotenv').config(); | |
const billionUsers = mongoose.model('User', { | |
n: { |
This file contains 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
// /test/server/models/User.test.js | |
// see https://github.com/vladgolubev/jest-mongodb for preparing in-memory mongoDB for this test. | |
const mongoose = require('mongoose'); | |
const User = require('../../../server/models/User'); | |
describe('slugify', () => { | |
beforeAll(async () => { | |
await mongoose.connect(global.__MONGO_URI__); | |
console.log('connected'); |
mongodb-memory-server doesn't work with mongodb v4 on Ubuntu 18.04
sudo apt-get install libcurl3
may help
This file contains 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
const fs = require('fs'); | |
const stringify = require('json-stringify-safe'); | |
const mongoose = require('mongoose'); | |
mongoose.Promise = global.Promise; | |
async function main() { | |
let _id = ''; | |
const mongoUri = 'mongodb://localhost/pre'; |
Some text here, common color
Code without syntax
some more text, still looks fine
let it = 'be';//code with js syntax.
This file contains 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
import colorDialog from './vanillaColorDialog'; | |
document.getElementById('some-other-button').addEventListener('click',function(e){ | |
// auto position is by default | |
colorDialog(e, '#000000'/* ,{ popup: 'auto', popup: ['right', 'left', 'bottom', 'top'], otherVanillaOption: 'whatever' }*/).then(console.log); | |
}); |
This file contains 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
const { eachDeep } = require('deepdash/standalone') | |
const mongoose = require('mongoose') | |
const RandomSchema = mongoose.Schema({ items: [mongoose.Schema()] }) | |
const RandomModel = mongoose.model('random', RandomSchema) | |
function demo () { | |
const myDocument = new RandomModel({ | |
items: [{}] | |
}) |
This file contains 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
[package] | |
name = "indexed_hash_map" | |
version = "0.1.0" | |
edition = "2021" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
mongodb = "2.3.0" | |
rustc-hash = "1.1.0" |
OlderNewer