Skip to content

Instantly share code, notes, and snippets.

@scottlepp
scottlepp / Mongo.md
Created October 28, 2020 16:45
Mongo

Observing and visualizing MongoDB with Grafana The official MongoDB Plugin for Grafana


The Grafana MongoDB plugin allows observation and visualization of not only your MongoDB data, but also allows capturing valuable diagnostic metrics so you can monitor your MongoDB database/cluster.

Observing and Visualizing your MongoDB Data

Lets take a look at some sample data, from a database called sample_mflix, provided by

@scottlepp
scottlepp / search.html
Created March 12, 2019 17:25
Voyager Web Components
<html>
<head>
<!-- Web Component Bundle -->
<link href="https://unpkg.com/voyager-components@0.0.1/dist/voyager.css" rel="stylesheet">
<script src='https://unpkg.com/voyager-components@0.0.1/dist/voyager.js'></script>
</head>
<body>
<!-- Voyager Web Components -->
<search-page>
function flatten(data) {
return data.reduce(( acc, current ) => {
if (Array.isArray(current)) {
return acc.concat(flatten(current));
} else {
return acc.concat(current);
}
}, [])
}
{
"name": "parcel",
"version": "1.0.0",
"description": "test",
"main": "index.ts",
"author": "scott",
"license": "MIT",
"devDependencies": {
"@vue/component-compiler-utils": "^2.0.0",
"babel-cli": "^6.26.0",
import { Component, Vue, Prop, Provide } from 'vue-property-decorator'
@Component()
export default class App extends Vue {
@Provide()
foo = 'foo';
@Provide()
bar = 'bar';
<template>
<div id="app">
<header>foo</header>
<div>{{ bar }}</div>
</div>
</template>
<script lang="ts">
import App from './app-class';
export default App;
import Vue from 'vue';
import App from './app.vue';
new Vue({
el: '#app',
render: h => h(App)
});
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div id="app"></div>
<script src="./src/main.ts"></script>
const http = require('http');
exports.handler = async (event, context) => {
// console.log('Received event:', JSON.stringify(event, null, 2));
return new Promise((resolve, reject) => {
try {
const options = {
host: 'ec2-18-191-89-162.us-east-2.compute.amazonaws.com',
path: '/api/repos/r1639420d605/index?delta=true&clear=false',
group: movies
Actor = {
actor_id,movie_id
0000138,0120338
0000701,0120338
0000708,0120338
0000870,0120338
0000200,0120338
0000434,0076759