Skip to content

Instantly share code, notes, and snippets.

View mariomui's full-sized avatar

Mario Mui mariomui

View GitHub Profile
@mariomui
mariomui / M220JS.md
Created July 23, 2019 04:04
M220JS: MongoDB for Javascript Developers

M220JS

Using the Course without Cloud DBs

  • As a user I want to complete this course without using my cloud or using the local version of the db.

Overview

The instructions here will both be imperative and declarative. It wont have any answers to the course. It will just be a collection of thoughts and deep dives into the code.

import http from 'k6/http';
import { check, sleep } from 'k6';
export const options = {
vus: 200,
duration: '600s',
};
const randomRoom = Math.floor(Math.random() * (1000000) + 1000000);
export default function () {

#QUERIES (NO PRIMARY KEYS) CASSANDRA (DAY ONE)

READING (SELECT * FROM SIMILARS WHERE ID = 999999);

category_id | clustering_id | bed | cost | description | favorite | picture| premium | rcount | stars | title 1 | 999999 | 6 | 102 | Ut quis mollit est labore reprehenderit. Consequat culpa fugiat aliqua dolore enim exercitation tempor incididunt laborum et laboris amet ad elit. Elit mollit anim culpa sit aute cillum enim magna ut ea consequat id irure. | False | http://d1bah53dmo2q93.cloudfront.net/999.jpg | True | 1396 | 5 | Ullamco irure quis minim enim enim amet fugiat eiusmod anim proident.

(1 rows)

  • Tracing session: 9a986dc0-16c5-11e9-8208-b3a911c7ed43
  • activity | timestamp | source | source_elapsed | client
@mariomui
mariomui / example.MD
Last active December 22, 2018 00:16
Example API call
// --------------------------------------------- SERVER CODE --------------------------------------------- //
app.get('/rooms/:id/pictures', function (req, res) {
  console.log('hello');
  findPicturesByRoomId(req.params.id)
    .then(function (images) {
      res.send(images.image_url);
    });
});
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<div class="renderbox">
<style scoped>