This file contains hidden or 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
# Instructions for Using Zero Custom Mutators | |
## Overview | |
Zero Custom Mutators provide a powerful mechanism for defining data write operations beyond simple CRUD. They allow you to embed arbitrary code within your write logic, running both client-side for optimistic updates and server-side for authority and complex operations. | |
**Key Concepts:** | |
- **Arbitrary Code:** Mutators are functions, enabling complex validation, permissions, calling external services (like LLMs or sending emails), calling queue, etc. | |
- **Client-Side Execution:** Mutators run immediately on the client for instant UI feedback. |
This file contains hidden or 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
# To be placed inside .github/actions like .github/actions/cleanup-pr/action.yml | |
name: "Cleanup PR Database Resources" | |
description: "Cleanup database resources for a specific PR" | |
inputs: | |
pr_number: | |
description: "PR number to cleanup" | |
required: true | |
pg_cluster_url: |
This file contains hidden or 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
version: "3.3" | |
services: | |
charts: | |
image: quay.io/mongodb/charts:v0.10.0 | |
hostname: charts | |
ports: | |
# host:container port mapping. If you want MongoDB Charts to be | |
# reachable on a different port on the docker host, change this | |
# to <port>:80, e.g. 8888:80. |
This file contains hidden or 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
// Remember to overwite the code in CodeShare, JSFiddle, etc. to restore the inital state of the test and to avoid | |
// showing to candidates the changes made during other interwies | |
// TASKS: | |
// 1. Ask to developer to analyze the above React component: | |
// - The dev should be able read, understand and explain the component | |
// - The dev should be able to explain why it's necessary to .bind the method .addItem (and what other option we have: arrow function) | |
// - The dev should be able to understand that it's a functional component | |
// - The dev should be able to describe the behaviour of the component without rendering it |
This file contains hidden or 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
// Remember to overwite the code in CodeShare, JSFiddle, etc. to restore the inital state of the test and to avoid | |
// showing to candidates the changes made during other interwies | |
// TASKS: | |
// 1. Ask to developer to analyze the provide (broken) snippet: | |
// - The dev should be able to understand the intent of the snipped | |
// - The dev should be able to predict the (unexpected) behaviour | |
// - The dev should be able to provide at least one fix (and discuss about it) | |
const initialValues = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; |
This file contains hidden or 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
// Remember to overwite the code in CodeShare, JSFiddle, etc. to restore the inital state of the test and to avoid | |
// showing to candidates the changes made during other interwies | |
// TASKS: | |
// 1. Ask to developer to write a foreach function: | |
// - The dev should be familiar with .forEach/.each() | |
// - The dev should be familiar with the interface of these methods | |
// - The dev should be able to implement it (quite easy, see below for the implementation) | |
// 2. Ask to developer to write a map function: | |
// - The dev should be familiar with .map() |
This file contains hidden or 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
// Remember to overwite the code in CodeShare, JSFiddle, etc. to restore the inital state of the test and to avoid | |
// showing to candidates the changes made during other interwies | |
// TASKS: | |
// 1. Ask to developer to go through the file and analyze it. The dev should: | |
// - Notice that the first comment return "undefined" | |
// - Notice that the second comment return "of Barcelona's weather" | |
// - Talk about hoisting | |
// - Identify what would happen if we would use "let" instead of "var" (ReferenceError: testVar is not defined) |
This file contains hidden or 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
// Remember to overwite the code in CodeShare, JSFiddle, etc. to restore the inital state of the test and to avoid | |
// showing to candidates the changes made during other interwies | |
// TASKS: | |
// 1. Ask to developer to go through the file and analyze it. The dev should notice: | |
// - Constructor (at this point we can talk also about classes in ES6 | |
// - Destructuring | |
// - String interpolation | |
// - Context (and should notice (and fix) that the callback passed to the onclick will log "I'm a button and I undefined" because it's not bound to | |
// the context ('dog') |