Consider this block-level code:
var test = true;
Consider the test
variable. It does not worry about clothes or food. Yet it holds such beautiful truth.
const assert = require('assert'); | |
const mongoose = require('mongoose'); | |
mongoose.connect('mongodb://localhost/test-mongoose-default-null'); | |
describe('mongoose', function () { | |
for (const {id, buildSchema, } of [ | |
{ | |
id: 'FooNull', | |
buildSchema: () => new mongoose.Schema({ |
const assert = require('assert'); | |
const mongoose = require('mongoose'); | |
const ThingSchema = new mongoose.Schema({ | |
// https://stackoverflow.com/a/44336895/429091, doesn’t support | |
// subdocuments. | |
undefinedDisallowed: { | |
type: String, | |
required: function () { | |
return this.undefinedDisallowed === undefined; |
ohnob@DESKTOP-A4G2C0J MSYS ~/repos/mongoose-validators-hard-to-use | |
$ node --version | |
v6.11.1 | |
ohnob@DESKTOP-A4G2C0J MSYS ~/repos/mongoose-validators-hard-to-use | |
$ npm list mongoose | |
[email protected] C:\Users\ohnob\repos\mongoose-validators-hard-to-use | |
`-- [email protected] extraneous | |
npm ERR! extraneous: [email protected] C:\Users\ohnob\repos\mongoose-validators-hard-to-use\node_modules\mongoose |
$ ./skipDir.sh | |
/a/b/c is permitted | |
/e/f/blah is banned |
using System.Collections; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
IEnumerable enumerable = new[] | |
{ | |
"a", | |
"b", |
gcc -Wall -o cForLoop cForLoop.c |
Consider this block-level code:
var test = true;
Consider the test
variable. It does not worry about clothes or food. Yet it holds such beautiful truth.
sam ~ # mongo --nodb ~/.mongo-do-auth.js ~/s2.js | |
MongoDB shell version: 2.6.12 | |
loading file: /root/.mongo-do-auth.js | |
2017-10-23T15:47:53.636+0000 Error: Invalid port number "asdf123@localhost" in connection string "mongodb://root:asdf123@localhost/admin" at src/mongo/shell/mongo.js:135 | |
failed to load: /root/.mongo-do-auth.js |
interface IParent | |
{ | |
void DoParentThings(); | |
} | |
interface IChild : IParent | |
{ | |
void DoChildThings(); | |
} | |
class Child : object, IChild | |
{ |
using System; | |
class Program | |
{ | |
static void Main() | |
{ | |
var b = new Base(); | |
b.DoSomething(); | |
// The answer is 42! |