\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{ProLoser} \pdfinfo{ /Title (sailsjs.pdf) /Creator (Cheatography) /Author (ProLoser) /Subject (SailsJS Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{28A0B2} \definecolor{LightBackground}{HTML}{F1F9FA} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{SailsJS Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{ProLoser} via \textcolor{DarkBackground}{\uline{cheatography.com/1600/cs/3124/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}ProLoser \\ \uline{cheatography.com/proloser} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 2nd January, 2015.\\ Updated 12th May, 2016.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{3} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Model Validations}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{after:}} {\emph{\{Date object\}}}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{alpha:}} {\emph{\{boolean\}}}} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{alphadashed:}} {\emph{\{boolean\}}}} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{alphanumeric:}} {\emph{\{boolean\}}}} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{alphanumericdashed:}} {\emph{\{boolean\}}}} \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{array:}} {\emph{\{boolean\}}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}strings formatted as arrays don't pass} \tn % Row Count 7 (+ 2) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{before:}} {\emph{\{Date object\}}}} \tn % Row Count 8 (+ 1) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{boolean:}} {\emph{\{boolean\}}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}strings fail} \tn % Row Count 10 (+ 2) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{contains:}} {\emph{\{string?RegEx?\}}}} \tn % Row Count 11 (+ 1) % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{creditcard:}} {\emph{\{boolean\}}}} \tn % Row Count 12 (+ 1) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{date:}} {\emph{\{boolean\}}}} \tn % Row Count 13 (+ 1) % Row 11 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{datetime:}} {\emph{\{boolean\}}}} \tn % Row Count 14 (+ 1) % Row 12 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{decimal:}} {\emph{\{boolean\}}}} \tn % Row Count 15 (+ 1) % Row 13 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{email:}} {\emph{\{boolean\}}}} \tn % Row Count 16 (+ 1) % Row 14 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{empty:}} {\emph{\{boolean\}}}} \tn % Row Count 17 (+ 1) % Row 15 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{equals:}} {\emph{\{mixed\}}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}=== comparison} \tn % Row Count 19 (+ 2) % Row 16 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{falsey:}} {\emph{\{boolean\}}}} \tn % Row Count 20 (+ 1) % Row 17 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{finite:}} {\emph{\{boolean\}}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}can be coerced to a finite number} \tn % Row Count 22 (+ 2) % Row 18 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{float:}} {\emph{\{boolean\}}}} \tn % Row Count 23 (+ 1) % Row 19 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{hexadecimal:}} {\emph{\{boolean\}}}} \tn % Row Count 24 (+ 1) % Row 20 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{hexColor:}} {\emph{\{boolean\}}}} \tn % Row Count 25 (+ 1) % Row 21 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{in:}} {\emph{\{array\}}}} \tn % Row Count 26 (+ 1) % Row 22 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{int:}} {\emph{\{boolean\}}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}alias for integer} \tn % Row Count 28 (+ 2) % Row 23 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{integer:}} {\emph{\{boolean\}}}} \tn % Row Count 29 (+ 1) % Row 24 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{ip:}} {\emph{\{boolean\}}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}IPv4 or IPv6} \tn % Row Count 31 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Model Validations (cont)}} \tn % Row 25 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{ipv4:}} {\emph{\{boolean\}}}} \tn % Row Count 1 (+ 1) % Row 26 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{ipv6:}} {\emph{\{boolean\}}}} \tn % Row Count 2 (+ 1) % Row 27 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{is:}} {\emph{\{RegEx\}}}} \tn % Row Count 3 (+ 1) % Row 28 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{json:}} {\emph{\{boolean\}}}} \tn % Row Count 4 (+ 1) % Row 29 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{len:}} {\emph{\{?\}}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}is integer \textgreater{} param1 \&\& \textless{} param2. {\bf{(Where are params defined?)}}} \tn % Row Count 7 (+ 3) % Row 30 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{lowercase:}} {\emph{\{boolean\}}}} \tn % Row Count 8 (+ 1) % Row 31 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{max:}} {\emph{\{number\}}}} \tn % Row Count 9 (+ 1) % Row 32 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{minLength:}} {\emph{\{int\}}}} \tn % Row Count 10 (+ 1) % Row 33 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{not:}} {\emph{\{RegEx\}}}} \tn % Row Count 11 (+ 1) % Row 34 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{notContains:}} {\emph{\{string?RegEx?\}}}} \tn % Row Count 12 (+ 1) % Row 35 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{notEmpty:}} {\emph{\{boolean\}}}} \tn % Row Count 13 (+ 1) % Row 36 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{notIn:}} {\emph{\{string|array\}}}} \tn % Row Count 14 (+ 1) % Row 37 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{notNull:}} {\emph{\{boolean\}}}} \tn % Row Count 15 (+ 1) % Row 38 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{notRegex:}} {\emph{\{boolean?\}}}} \tn % Row Count 16 (+ 1) % Row 39 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{null:}} {\emph{\{boolean\}}}} \tn % Row Count 17 (+ 1) % Row 40 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{number:}} {\emph{\{boolean\}}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}NaN is considered a number} \tn % Row Count 19 (+ 2) % Row 41 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{numeric:}} {\emph{\{boolean\}}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}string contains only numbers} \tn % Row Count 21 (+ 2) % Row 42 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{object:}} {\emph{\{boolean\}}}} \tn % Row Count 22 (+ 1) % Row 43 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{regex:}} {\emph{\{boolean?\}}}} \tn % Row Count 23 (+ 1) % Row 44 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{protected:}} {\emph{\{boolean\}}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}remove attribute when toJSON is called on instance} \tn % Row Count 26 (+ 3) % Row 45 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{required:}} {\emph{\{boolean\}}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}during creation only} \tn % Row Count 28 (+ 2) % Row 46 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{string:}} {\emph{\{boolean\}}}} \tn % Row Count 29 (+ 1) % Row 47 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{text:}} {\emph{\{boolean\}}}} \tn % Row Count 30 (+ 1) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Model Validations (cont)}} \tn % Row 48 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{truthy:}} {\emph{\{boolean\}}}} \tn % Row Count 1 (+ 1) % Row 49 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{undefined:}} {\emph{\{boolean\}}}} \tn % Row Count 2 (+ 1) % Row 50 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{unique:}} {\emph{\{boolean\}}}} \tn % Row Count 3 (+ 1) % Row 51 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{uppercase:}} {\emph{\{boolean\}}}} \tn % Row Count 4 (+ 1) % Row 52 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{url:}} {\emph{\{boolean\}}}} \tn % Row Count 5 (+ 1) % Row 53 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{urlish:}} {\emph{\{boolean\}}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}/\textasciicircum{}\textbackslash{}s({[}\textasciicircum{}\textbackslash{}/{]}+.)+.+\textbackslash{}s*\$/g} \tn % Row Count 7 (+ 2) % Row 54 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{uuid:}} {\emph{\{boolean\}}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}UUID v3, v4 or v5} \tn % Row Count 9 (+ 2) % Row 55 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{uuidv3:}} {\emph{\{boolean\}}}} \tn % Row Count 10 (+ 1) % Row 56 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{uuidv4:}} {\emph{\{boolean\}}}} \tn % Row Count 11 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/concepts/ORM/Validations.html?q=custom-validation-rules"\}\}Define custom validation using the `types` property of the model} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Websocket PupSub Methods}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/reference/websockets/resourceful-pubsub/message.html"\}\}{\bf{message}}(record|id,message,{\emph{{[}request{]}}})} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Message: \{id,verb:'messaged',data\}} \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/reference/websockets/resourceful-pubsub/publishCreate.html"\}\}{\bf{publishCreate}}(data,{\emph{{[}request{]}}})} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Message: \{id,verb:'created',data\}} \tn % Row Count 8 (+ 4) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/reference/websockets/resourceful-pubsub/publishUpdate.html"\}\}{\bf{publishUpdate}}(id,{\emph{{[}data{]},{[}request{]},{[}options{]}}})} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Message: \{id,verb:'updated',data:object,previous:object\}} \tn % Row Count 14 (+ 6) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/reference/websockets/resourceful-pubsub/publishAdd.html"\}\}{\bf{publishAdd}}(id,attributes,idAdded,{\emph{{[}request{]},{[}options{]}}})} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Message: \{id,verb:'addedTo',attribute,addedId\}} \tn % Row Count 19 (+ 5) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/reference/websockets/resourceful-pubsub/publishDestroy.html"\}\}{\bf{publishDestroy}}(id,{\emph{{[}request{]},{[}options{]}}})} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Message: \{id,verb:'destroyed',previous\}} \tn % Row Count 23 (+ 4) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/reference/websockets/resourceful-pubsub/publishRemove.html"\}\}{\bf{publishRemove}}(id,attribute,removedId,{\emph{{[}request{]},{[}options{]}}})} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Message: \{id,verb:'removedFrom',attribute,removedId\}} \tn % Row Count 29 (+ 6) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/reference/websockets/resourceful-pubsub/subscribe.html"\}\}{\bf{subscribe}}(request,record(s),{\emph{{[}context(s){]}}})} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Subscribes to record(s) changes. {\emph{Works for socket requests only.}}} \tn % Row Count 34 (+ 5) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Websocket PupSub Methods (cont)}} \tn % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/reference/websockets/resourceful-pubsub/unsubscribe.html"\}\}{\bf{unsubscribe}}(request,record(s),{\emph{{[}context(s){]}}})} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Unsubscribes from record(s) changes. {\emph{Works for socket requests only.}}} \tn % Row Count 6 (+ 6) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/reference/websockets/resourceful-pubsub/subscribers.html"\}\}{\bf{subscribers}}(record|id,{\emph{{[}context(s){]}}}) {\emph{\{Array(Socket)\}}}} \tn % Row Count 10 (+ 4) % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/reference/websockets/resourceful-pubsub/watch.html"\}\}{\bf{watch}}(request)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Subscribe to {\bf{publishCreate()}}. Works for socket requests only.} \tn % Row Count 15 (+ 5) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/reference/websockets/resourceful-pubsub/unwatch.html"\}\}{\bf{unwatch}}(request)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Unsubscribe to {\bf{publishCreate()}}. Works for socket requests only.} \tn % Row Count 20 (+ 5) \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/reference/websockets/resourceful-pubsub"\}\}http://sailsjs.org/\#/documentation/reference/websockets/resourceful-pubsub} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Model Lifecycle Callbacks}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{beforeValidate:}} {\emph{\{fn(values, next)\}}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}`create` and `update`} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{afterValidate:}} {\emph{\{fn(values, next)\}}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}`create` and `update`} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{beforeCreate:}} {\emph{\{fn(values, next)\}}}} \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{afterCreate:}} {\emph{\{fn(newlyInsertedRecord, next)\}}}} \tn % Row Count 6 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{beforeUpdate:}} {\emph{\{fn(valuesToUpdate, next)\}}}} \tn % Row Count 7 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{afterUpdate:}} {\emph{\{fn(updatedRecord, next)\}}}} \tn % Row Count 8 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{beforeDestroy:}} {\emph{\{fn(criteria, next)\}}}} \tn % Row Count 9 (+ 1) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{afterDestroy:}} {\emph{\{fn(destroyedRecords, next)\}}}} \tn % Row Count 10 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Waterline Model Methods}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{query}}(query, callback(err, results))} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Only works with PostgreSQL and mySQL} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{native}}(callback(err, collection))} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Only works with MongoDB. For low-level usage do `require('mongodb')` directly.} \tn % Row Count 5 (+ 3) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{count}}({[}criteria{]}, {[}callback{]}) {\emph{\{query\}}}} \tn % Row Count 6 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{find}}(criteria, {[}callback{]}) {\emph{\{query\}}}} \tn % Row Count 7 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{findOne}}(criteria, {[}callback{]}) {\emph{\{query\}}}} \tn % Row Count 8 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{findOrCreate}}(criteria, {[}callback{]}) {\emph{\{query\}}}} \tn % Row Count 9 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{create}}(data, {[}callback{]}) {\emph{\{query\}}}} \tn % Row Count 10 (+ 1) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{destroy}}(criteria, {[}callback{]}) {\emph{\{query\}}}} \tn % Row Count 11 (+ 1) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{update}}(criteria, data, {[}callback{]}) {\emph{\{query\}}}} \tn % Row Count 12 (+ 1) % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{stream}}(criteria, {[}options{]}) {\emph{\{stream\}}}} \tn % Row Count 13 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{If a callback {\bf{is not}} passed, most methods return chainable `query` object which ends with `.exec(callback)`} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Waterline Record Methods}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/reference/waterline/populated-values/add.html"\}\}{\bf{add}}({\emph{\{object|id\}}})} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Add a many2many relationship} \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/reference/waterline/populated-values/remove.html"\}\}{\bf{remove}}({\emph{\{object|id\}}})} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Remove a many2many relationship} \tn % Row Count 8 (+ 4) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/reference/waterline/records/toJSON.html"\}\}{\bf{toJSON}}() {\emph{\{clonedObject\}}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Contains instance methods} \tn % Row Count 12 (+ 4) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/reference/waterline/records/toObject.html"\}\}{\bf{toObject}}() {\emph{\{clonedData\}}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Does not contain instance methods} \tn % Row Count 16 (+ 4) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/reference/waterline/records/validate.html"\}\}{\bf{validate}}(callback(err))} \tn % Row Count 19 (+ 3) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/reference/waterline/records/save.html"\}\}{\bf{save}}(callback)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}persists any changes to the database. Required for {\bf{add()}} / {\bf{remove()}}} \tn % Row Count 24 (+ 5) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Waterline Queries}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/reference/waterline/queries/exec.html"\}\}{\bf{exec}}(callback)} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Executes a query at the end of a query chain.} \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/reference/waterline/queries/limit.html"\}\}{\bf{limit}}(int) {\emph{\{query\}}}} \tn % Row Count 7 (+ 3) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/reference/waterline/queries/populate.html"\}\}{\bf{populate}}(foreignKey, {\emph{{[}query{]}}}) {\emph{\{query\}}}} \tn % Row Count 10 (+ 3) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/reference/waterline/queries/populateAll.html"\}\}{\bf{populateAll}}({\emph{{[}query{]}}}) {\emph{\{query\}}}} \tn % Row Count 13 (+ 3) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/reference/waterline/queries/skip.html"\}\}{\bf{skip}}(int) {\emph{\{query\}}}} \tn % Row Count 16 (+ 3) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/reference/waterline/queries/sort.html"\}\}{\bf{sort}}(sortString) {\emph{\{query\}}}} \tn % Row Count 19 (+ 3) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/reference/waterline/queries/where.html"\}\}{\bf{where}}(criteria) {\emph{\{query\}}}} \tn % Row Count 22 (+ 3) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/reference/waterline/queries?q=promises"\}\}{\bf{then}}(callback) {\emph{\{query\}}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Bluebird Promise Method} \tn % Row Count 26 (+ 4) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/reference/waterline/queries?q=promises"\}\}{\bf{catch}}(callback) {\emph{\{query\}}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Bluebird Promise Method} \tn % Row Count 30 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/reference/waterline/queries"\}\}Query objects are returned by waterline methods {\bf{if a callback was not passed}}.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Model Settings}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/concepts/ORM/model-settings.html?q=migrate"\}\}{\bf{migrate:}} {\emph{\{string\}}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}{\bf{safe:}} never auto-migrate db. {\bf{alter:}} auto-migrate db and {\emph{attempt}} to keep existing. {\bf{drop:}} drop all data on every lift.} \tn % Row Count 6 (+ 6) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/concepts/ORM/model-settings.html?q=schema"\}\}{\bf{schema:}} {\emph{\{boolean\}}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}only specified attributes are saved} \tn % Row Count 10 (+ 4) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/concepts/ORM/model-settings.html?q=connection"\}\}{\bf{connection:}} {\emph{\{string\}}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}\{\{popup="http://sailsjs.org/\#/documentation/reference/sails.config/sails.config.connections.html"\}\}use specified connection config} \tn % Row Count 16 (+ 6) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/concepts/ORM/model-settings.html?q=identity"\}\}{\bf{identity:}} {\emph{\{string\}}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}lowercase version of filename} \tn % Row Count 20 (+ 4) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/concepts/ORM/model-settings.html?q=globalid"\}\}{\bf{globalId}} {\emph{\{string\}}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}\{\{popup="http://sailsjs.org/\#/documentation/concepts/Globals?q=disabling-globals"\}\}global variable name if enabled} \tn % Row Count 26 (+ 6) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{autoPK:}} {\emph{\{boolean\}}}} \tn % Row Count 27 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{autoCreatedAt:}} {\emph{\{boolean\}}}} \tn % Row Count 28 (+ 1) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{autoUpdatedAt:}} {\emph{\{boolean\}}}} \tn % Row Count 29 (+ 1) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{tableName:}} {\emph{\{string\}}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}table or collection to be used} \tn % Row Count 31 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Model Settings (cont)}} \tn % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{attributes:}} {\emph{\{object\}}}} \tn % Row Count 1 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/concepts/ORM/model-settings.html"\}\}http://sailsjs.org/\#/documentation/concepts/ORM/model-settings.html} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Model Attributes}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{type:}} {\emph{\{string\}}}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{~~string} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{~~text} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{~~integer} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{~~float} \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{~~date} \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{~~datetime} \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{~~boolean} \tn % Row Count 8 (+ 1) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{~~boolean} \tn % Row Count 9 (+ 1) % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{~~binary} \tn % Row Count 10 (+ 1) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{~~array} \tn % Row Count 11 (+ 1) % Row 11 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{~~json} \tn % Row Count 12 (+ 1) % Row 12 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{~~email} \tn % Row Count 13 (+ 1) % Row 13 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{defaultsTo:}} {\emph{\{mixed\}}}} \tn % Row Count 14 (+ 1) % Row 14 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{autoIncrement:}} {\emph{\{boolean\}}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}requires `type: 'integer'`} \tn % Row Count 16 (+ 2) % Row 15 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{unique:}} {\emph{\{boolean\}}}} \tn % Row Count 17 (+ 1) % Row 16 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{primaryKey:}} {\emph{\{boolean\}}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}\{\{popup="http://sailsjs.org/\#/documentation/concepts/ORM/model-settings.html?q=autopk"\}\}requires autoPK set to false} \tn % Row Count 21 (+ 4) % Row 17 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{enum:}} {\emph{\{array{[}string{]}\}}}} \tn % Row Count 22 (+ 1) % Row 18 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{size:}} {\emph{\{integer\}}}} \tn % Row Count 23 (+ 1) % Row 19 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{columnName:}} {\emph{\{string\}}}} \tn % Row Count 24 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/concepts/ORM/Attributes.html"\}\}Each attribute can have an object definition or just a string specifying containing type} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Query Language}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Where:}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Mode.find(\{ where: conditions \})} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{~~\{ property: 'value' \}} \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{~~{\bf{\{ property: \{ '{\emph{comparison}}': 'value' \} \}}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Complex comparison options. Works for dates: `\{ '\textgreater{}': new Date('2/4/2014') \}`} \tn % Row Count 7 (+ 4) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{~~~\{ '\textless{}' | 'lessThan' : value \}} \tn % Row Count 8 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{~~~\{ '\textless{}=' | 'lessThanOrEqual' : value \}} \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{~~~\{ '\textgreater{}' | 'greaterThan' : value \}} \tn % Row Count 11 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{~~~\{ '\textgreater{}=' | 'greaterThanOrEqual' : value \}} \tn % Row Count 13 (+ 2) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{~~~\{ '!' | 'not' : value \}} \tn % Row Count 14 (+ 1) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{~~~\{ \seqsplit{'like|contains|startsWith|endsWith':} value \}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}{\bf{like:}} `'sea\%rch'` {\bf{contains:}} `'\%search\%'` {\bf{startsWith:}} `'search\%'` {\bf{endsWith:}} `'\%search'`} \tn % Row Count 19 (+ 5) % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{~~\{ property: {[}'value1', 'value2'{]} \}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Value in array} \tn % Row Count 21 (+ 2) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{~~\{ property: \{ '!' : {[}'value1', 'value2'{]} \} \}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Value not in array} \tn % Row Count 24 (+ 3) % Row 11 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{~~\{ or: {[} \{ prop1: 'val1' \}, \{ prop2: val2 \} {]} \}} \tn % Row Count 26 (+ 2) % Row 12 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Limit:}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Mode.find(\{ limit: integer \})} \tn % Row Count 28 (+ 2) % Row 13 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{Skip:}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Mode.find(\{ skip: integer \})} \tn % Row Count 30 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Query Language (cont)}} \tn % Row 14 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Sort:}}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Mode.find(\{ sort: sortString \})} \tn % Row Count 2 (+ 2) % Row 15 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{~~\{ sort: 'property' | 'property ASC' \}} \tn % Row Count 3 (+ 1) % Row 16 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{~~\{ sort: 'property DESC' \}} \tn % Row Count 4 (+ 1) % Row 17 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{~~\{ sort: \{ 'property1' : 1, 'property2': 0 \} \}} \tn % Row Count 6 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Model Associations}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/concepts/ORM/Associations/OnetoMany.html"\}\}{\bf{Has-One:}}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{~~{\bf{model:}} 'model'} \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/concepts/ORM/Associations/ManytoMany.html"\}\}{\bf{Has-Many:}}} \tn % Row Count 6 (+ 3) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{~~{\bf{collection:}} 'model'} \tn % Row Count 7 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{~~{\bf{via:}} 'foreignPropertyName'} \tn % Row Count 8 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{~~{\bf{{[}{\emph{dominant}}{]}:}} true} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}\{\{popup="http://sailsjs.org/\#/documentation/concepts/ORM/Associations/Dominance.html"\}\}Optionally used if both sides use `via` property} \tn % Row Count 12 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\{\{popup="http://sailsjs.org/\#/documentation/concepts/ORM/Associations"\}\}Associations are defined in the attributes property of a model} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}