20 Matching Annotations
  1. Nov 2022
    1. Export data using the Splunk REST API

      Use the Splunk REST API to access data from the command line or a Web browser.

  2. May 2022
    1. // To make a nested object required, use a single nested schema const nameSchema = new Schema({ first: String, last: String }); personSchema = new Schema({ name: { type: nameSchema, required: true } });

      Notice How nameSchema is nested within personSchema object.

    2. required: function() { return this.bacon > 3; }

      This is cool. A custom required condition.

    3. Numbers have min and max validators. Strings have enum, match, minLength, and maxLength validators.

      Click the links here to get more detail on the validation specifics of Number and Strings types.

    4. Validation

      Mongoose Validation. This is essential.

  3. Apr 2021
  4. Feb 2021
    1. try { const value = await localforage.getItem('somekey'); // This code runs once the value has been loaded // from the offline store. console.log(value); } catch (err) { // This code runs if there were any errors. console.log(err); }

      This looks like the best approach for me. async/await

    1. return new Promise((resolve, reject) =>

      Notice that functions that you want to call (which you will prepend with "await"), must be structured to ALWAYS return a Promise as has been done here.

    2. Nicely explains how to make asynchronous calls to API/services. Async/Await

    3. try/catch block to be able to catch the error


      The final result of they try catch block it that the code that follows below is almost exactly like how I usually code synchronously. It's so much easier to read.

    4. await without async is bad

      The are ALWAYS used together.

    5. Callback Hell

      This is so easy to fall into. I've done it a few times. Always try to avoid this.

    6. Promises

      Never forget this. It's very important.

    1. <pre>  My Bonnie lies over the ocean.   My Bonnie lies over the sea.  My Bonnie lies over the ocean.  Oh, bring back my Bonnie to me.</pre>

      This looks really useful.

    1. Getting started

      This is my first annotation using this extension. It explains how to get started.